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 -> SQL help needed

SQL help needed

From: Peter Laursen <ptl_at_edbgruppen.dk>
Date: 20 Aug 1999 13:53:20 GMT
Message-ID: <01beeb1b$da969aa0$2c289a0a@apollo>


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

Original text of this message

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