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?
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]]
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
--
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?
Thanks!
---(end of broadcast)---
TIP 2: you can get off all lists at once with t