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

Home -> Community -> Usenet -> c.d.o.server -> help with comparing dates and deleteing oldest

help with comparing dates and deleteing oldest

From: <jeffchirco_at_gmail.com>
Date: 4 Mar 2005 09:53:45 -0800
Message-ID: <1109958825.692412.302200@f14g2000cwb.googlegroups.com>


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

Original text of this message

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