Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Second highest value
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
![]() |
![]() |