Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Find the first record, for every day
Assuming you have hh24:mm information in your date columns
select date_, status
from t1 x
where date_ =
(
select min(date_) from t1 y where trunc(y.date_) = trunc(x.date_)
)
needless to say you would need a function based index on the date
column or the statement will perform horribly, and won't scale.
Hth
-- Sybrand Bakker Senior Oracle DBAReceived on Wed Dec 21 2005 - 04:16:36 CST