Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> help with comparing dates and deleteing oldest
Ok I have a table (assoc) with a employee id numbers and dates. Some
employees have more than one record on one day. But now we want to
trunc the date field to get rid of the time on the end, this will
create duplicate records though. So first I want to delete the older
records and only keep the most current record where an employee id as
more than one record on the same day. How would I go about doing
this?
I have my query that finds the emoployee id and dates were they have
more than one record on a single day.
select a.dbassoc, a.dbdate from assoc a, assoc b
where a.dbassoc = b.dbassoc
and trunc(a.dbdate) = trunc(b.dbdate)
and a.dbdate != b.dbdate
order by dbassoc;
Thanks for your help
Jeff
jchirco_at_innout.com
Received on Fri Mar 04 2005 - 11:53:45 CST
![]() |
![]() |