Re: [SQL] Sorting and then...

2001-04-10 Thread Jason Earl
SELECT name FROM test ORDER BY id DESC LIMIT 10; Take care, Jason --- Wei Weng <[EMAIL PROTECTED]> wrote: > Suppose I have a table > > create table test > ( > id integer, > name text > ); > > And I want to get the names of the largest 10 "id"s. > How can I do that in > sql?

RE: [SQL] Sorting and then...

2001-04-10 Thread Michael Ansley
Title: RE: [SQL] Sorting and then... But if you want the largest 10, then you can: SELECT name FROM ORDER BY id DESC LIMIT 10; assuming that you mean largest numerically. Cheers... MikeA >> -Original Message- >> From: Roberto Mello [mailto:[EMAIL PROTECTED]]

Re: [SQL] Sorting and then...

2001-04-09 Thread Roberto Mello
On Mon, Apr 09, 2001 at 07:22:52PM -0400, Wei Weng wrote: > And I want to get the names of the largest 10 "id"s. How can I do that in > sql? What do you mean by "largest"? Largest id? "largest" text string? If it's the id you can do: select max(id) from ; -Roberto --