Home » RDBMS Server » Server Administration » Duplicate entries in a table
Duplicate entries in a table [message #370863] Sun, 27 February 2000 03:00 Go to next message
Nick
Messages: 64
Registered: February 2000
Member
Hi,

IN one of my table i have records which have duplicate entries only differ by one date field.
Question is...

1) i want to see (make sure) that all the entries are repeated only differ by that date field.
2) and i want to delete that rows.

Thanks,
Nick
Re: Duplicate entries in a table [message #370867 is a reply to message #370863] Mon, 28 February 2000 12:12 Go to previous message
Suresh
Messages: 189
Registered: December 1998
Senior Member
hi,
Use following Sql statement to retrieve duplicate rows in database.
select * from dup_tab a where dup_col in
(select b.dup_col from dup_tab b where a.dup_col=b.dup_col and a.rowid>b.rowid )

to delete those rows from table :

delete from dup_tab a where dup_col in
(select b.dup_col from dup_tab b where a.dup_col=b.dup_col and a.rowid>b.rowid )
Previous Topic: self joins (cr and dr totals)
Next Topic: Re: how can I get Pro*c/c++
Goto Forum:
  


Current Time: Fri Oct 23 16:47:24 CDT 2020