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: Kenneth C Stahl <BluesSax_at_Unforgettable.com>
Date: Sat, 07 Aug 1999 08:40:32 -0400
Message-ID: <37AC2940.17BE63EC@Unforgettable.com>


select max(invoicedate)
from myview
union
select invoicedate
from myview
where invoicedate < (select max(invoicedate)

                                   from myview)
    and rownum = 1;

raorg_at_my-deja.com wrote:

> Hi all,
> I have a view:
> dealid,
> customerid,
> accountid,
> invoicedate,
> invoicenum,
>
> For group of dealid, customerid, accountid, How can I get the max
> invoicedate and the second highest invoice date value. preferably in
> one query, but two will definitely help.
>
> Thanks,
> Rajesh.
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Received on Sat Aug 07 1999 - 07:40:32 CDT

Original text of this message

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