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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: All rows with a value less than max?

Re: All rows with a value less than max?

From: Riyaj Shamsudeen <rshamsud_at_jcpenney.com>
Date: Tue, 22 Aug 2006 15:51:38 -0500
Message-ID: <44EB6E5A.80500@jcpenney.com>

select snap_id, snap_time from
 (
select snap_id, snap_time, max(snap_time) over () max_snap_time  from $stats where database_name='monkey'  ) where snap_time < max_snap_time

Collier,Joshua W - JDD-6 wrote:
> Hi,
>
> Stumped on this. I'm sure the answer is simple and elegant, just can't
> get my mind to stretch it.
>
> I need to retrieve all rows that have a value for time that is less than
> the max time. Is there a way to do this without a subquery?
>
> select snap_id,snap_time from $stats where database_name = 'donkey'
> and snap_time < (select max(snap_time) from $stats) ;
>
> Thanks,
>
> Josh C.
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>
>


The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If the reader of this message is not the intended recipient, you are hereby notified that your access is unauthorized, and any review, dissemination, distribution or copying of this message including any attachments is strictly prohibited. If you are not the intended recipient, please contact the sender and delete the material from any computer.

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Aug 22 2006 - 15:51:38 CDT

Original text of this message

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