Received: from akirason.se.verio.net (akirason.se.verio.net [204.27.64.122]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7LF89P35661 for ; Tue, 21 Aug 2001 11:08:10 -0400 (EDT) (envelope-from jeckermann@verio.net) Received: from beancounter (no-wkstns.gs.verio.net [204.27.67.225]) (authenticated) by akirason.se.verio.net (8.11.4/8.11.4) with ESMTP id f7LF6aI43200; Tue, 21 Aug 2001 10:06:36 -0500 (CDT) (envelope-from jeckermann@verio.net) Message-ID: <023901c12a53$11c61190$279c10ac@INTERNAL> From: "Jeff Eckermann" To: "Bhuvan A" , References: Subject: Re: Getting 'n-1'th record. Date: Tue, 21 Aug 2001 10:08:00 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200108/272 X-Sequence-Number: 4519 SELECT * FROM table ORDER BY field DESC LIMIT 1 OFFSET 1; This way you don't need to know the value of "n" in advance. The descending ORDER BY is to indicate a reversal of your intended ordering, so as to make the n-1'th record the second record. Note that getting the n-1'th record from an unordered list will not give meaningful results, because you cannot predict what will be returned. ----- Original Message ----- From: "Bhuvan A" To: Sent: Tuesday, August 21, 2001 2:41 AM Subject: Getting 'n-1'th record. > > hi all, > > consider below.. > > An sql query results with 'n' records. OK. > I need ONLY the 'n-1'th record. > > > HOW CAN I GET THIS? > > Thankx in advance! > > ====================================================================== > Q: What's the difference between the 1950's and the 1980's? > A: In the 80's, a man walks into a drugstore and states loudly, "I'd > like some condoms," and then, leaning over the counter, whispers, > "and some cigarettes." > > ====================================================================== > > Regards, > Bhuvaneswar. > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > >