pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Ansley <Michael.Ansley@intec-telecom-systems.com>
To: 'Roberto Mello' <rmello@cc.usu.edu>
To: wweng@pobox.com
Cc: pgsql-sql@postgresql.org
Subject: RE: Sorting and then...
Date: Tue, 10 Apr 2001 10:30:22 +0100
Message-ID: <7F124BC48D56D411812500D0B747251480F51A@fileserver002.intecsystems.co.uk> (raw)

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:rmello@cc.usu.edu]
>> Sent: 10 April 2001 03:41
>> To: wweng@pobox.com
>> Cc: pgsql-sql@postgresql.org
>> 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 majordomo@postgresql.org 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. 
__________________________________________________________________________

view thread (4+ messages)  latest in thread

Message-ID: <7F124BC48D56D411812500D0B747251480F51A@fileserver002.intecsystems.co.uk>
Permalink:  ../7F124BC48D56D411812500D0B747251480F51A@fileserver002.intecsystems.co.uk/
Also on:    postgresql.org/message-id/7F124BC48D56D411812500D0B747251480F51A@fileserver002.intecsystems.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: Michael.Ansley@intec-telecom-systems.com, rmello@cc.usu.edu, wweng@pobox.com
  Subject: Re: Sorting and then...
  In-Reply-To: <7F124BC48D56D411812500D0B747251480F51A@fileserver002.intecsystems.co.uk>
  References: <7F124BC48D56D411812500D0B747251480F51A@fileserver002.intecsystems.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox