Re: All rows with a value less than max?

  • From: Riyaj Shamsudeen <rshamsud@xxxxxxxxxxxx>
  • To: jwcollier@xxxxxxx
  • Date: Tue, 22 Aug 2006 15:51:38 -0500


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. --
//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.

Other related posts: