Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL help needed
In a table that looks like this:
create table t(
a int primary key,
b int,
c date,
d date)
I need to make (b,c) unique but duplicates exist. I want to delete all duplicates but one, leaving the row where d is newest. That is if t(1,1,01-01-99, 01-01-99) and t(2,1,01-01-99, 12-12-99) both exist, I want to keep the second. btw the timepart of the dates does matter, not just the date part.
Could you help me with a delete that does the above?
Thanks
Peter
Received on Fri Aug 20 1999 - 08:53:20 CDT