Title: RE: [SQL] Sorting and then...

But if you want the largest 10, then you can:

SELECT name FROM <table> ORDER BY id DESC LIMIT 10;

assuming that you mean largest numerically.

Cheers...


MikeA



>> -----Original Message-----
>> From: Roberto Mello [mailto:[EMAIL PROTECTED]]
>> Sent: 10 April 2001 03:41
>> To: [EMAIL PROTECTED]
>> Cc: [EMAIL PROTECTED]
>> Subject: Re: [SQL] Sorting and then...
>>
>>
>> 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 <table>;
>>
>>      -Roberto
>> --
>> +----| http://fslc.usu.edu USU Free Software & GNU/Linux
>> Club |------+
>>   Roberto Mello - Computer Science, USU - http://www.brasileiro.net
>>        http://www.sdl.usu.edu - Space Dynamics Lab, Developer   
>> Backup is for whimps!
>>
>> ---------------------------(end of
>> broadcast)---------------------------
>> TIP 3: if posting/reading through Usenet, please send an appropriate
>> subscribe-nomail command to [EMAIL PROTECTED] so that your
>> message can get through to the mailing list cleanly
>>



_________________________________________________________________________
This e-mail and any attachments are confidential and may also be privileged and/or copyright
material of Intec Telecom Systems PLC (or its affiliated companies). If you are not an
intended or authorised recipient of this e-mail or have received it in error, please delete
it immediately and notify the sender by e-mail. In such a case, reading, reproducing,
printing or further dissemination of this e-mail is strictly prohibited and may be unlawful.
Intec Telecom Systems PLC. does not represent or warrant that an attachment hereto is free
from computer viruses or other defects. The opinions expressed in this e-mail and any
attachments may be those of the author and are not necessarily those of Intec Telecom
Systems PLC.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
__________________________________________________________________________

Reply via email to