Hi
I have a table which has 580 rows and these are having duplicate rows . I want to get the distinct rows out of these . what SQL do I write to delete the half ie. 240 lines .
regards
Printable View
Hi
I have a table which has 580 rows and these are having duplicate rows . I want to get the distinct rows out of these . what SQL do I write to delete the half ie. 240 lines .
regards
DELETE FROM TAB1 A
WHERE ROWID > (SELECT MIN(ROWID) FROM TAB1 B
WHERE A.COL1=B.COL1
AND A.COL2=B.COL2
AND A.COL3=B.COL3
........)
Here TAB1 is the name of table and COL1, COL2, COL3.... are the names of the columns that make primary key for the table.
Sanjay