Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Puzzle ...
Raghu,
Suppose you have a table named Table_A
with three columns named as:
Col_1, Col_2 and Col_3 respectively.
Then you can use following query to delete duplicate rows from the table Table_A:-
DELETE FROM Table_A A
WHERE A.rowid > ( SELECT MIN (B.rowid)
FROM Table_A B WHERE B.Col_1 = A.Col_1 AND B.Col_2 = A.Col_2 AND B.Col_3 = B.Col_3 );
Hoope this helps,
Let me know if it worked for you, thanks!!
Manoj Jain
Oracle Certified Professional - OCP DBA
Chauncey Certified Oracle7 DBA
16-November-1998
In article <364F9289.1629E71B_at_india.hp.com>,
"K. Raghuraman" <kraghu_at_india.hp.com> wrote:
> Hi,
>
> I have a table with three columns and no keys defined. I want to
> eliminate only the duplicate records from the table in a single SQL
> delete statement. How do I construct my SQL statement ?
>
> Thanks and Regards,
>
> Raghu
>
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Nov 16 1998 - 05:08:37 CST