Rupesh
Rupesh

Reputation: 1

Need to find and delete duplicate records in Netezza

I need a netezza query to delete exact duplicate records and keep only unique records. with how many ways we can delete duplicates in netezza.

Thanks in advance. RG

Upvotes: 0

Views: 906

Answers (1)

Lars G Olsen
Lars G Olsen

Reputation: 1118

This is probably the least sofisticated Solution:

Create table X as select distinct * from YOURTABLE
;

---- make sure X looks as you expect ----

Truncate table YOURTABLE
;
Insert into YOURTABLE select * from X
;

You may choose to create the table X as ‘temp’, but the risk of loosing data is potentially higher if you are not 100% sure what you are doing...

Upvotes: 1

Related Questions