Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Second highest value

Re: Second highest value

From: <morris_minor_at_my-deja.com>
Date: Mon, 09 Aug 1999 16:54:08 GMT
Message-ID: <7on139$mh2$1@nnrp1.deja.com>


In article <37AC2940.17BE63EC_at_Unforgettable.com>,   BluesSax_at_Unforgettable.com wrote:
> select max(invoicedate)
> from myview
> union
> select invoicedate
> from myview
> where invoicedate < (select max(invoicedate)
> from myview)
> and rownum = 1;
>

Will this not just select, for the second value, simply the first record to come out of the database? Invoice date in this case is not guaranteed to be retrieved in date order, so it is not necessarily the second highest.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Mon Aug 09 1999 - 11:54:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US