Deleting Duplicate records...

Database
Enthusiast

Deleting Duplicate records...

Hi,
I have the following records in my multiset table:-

EN ENAME
----- ---------------
1 AAA
1 AAA
1 AAA
2 BBB
2 BBB

I would like to delete the duplicate records and retain only distinct records i.e the table should be left with:-

EN ENAME
----- ---------------
1 AAA
2 BBB

I am aware of the INSERT/SELECT to other table ....
But I would like to know if it can be done using a single DELETE
statement.
2 REPLIES
Teradata Employee

Re: Deleting Duplicate records...

If I am not wrong, it is in the documentation that it is not possible to delete duplicate rows in a MULTI-SET table, using just a single DELETE statement.

Regards,

Adeel
Enthusiast

Re: Deleting Duplicate records...

Hi,

you can change your table defination i.e

you have to change only the keyword "MULTISET" to "SET"

this will automatically take distinct records and avoid duplication