Write a single SQL to delete duplicate records from the a
single table based on a column value. I need only Unique
records at the end of the Query.

Answer Posted / tdguy

creating a new table would be the best option, if all the
field values are same, as far as i know.
CREATE NEW_TABLE AS OLD_TABLE WITH NO DATA;
INSERT INTO NEW_TABLE
SELECT COLUMN1, COLUMN2,COLUMN3 FROM OLD_TABLE
QUALIFY ROW_NUMBER() OVER
(PARTITION BY COLUMN1, COLUMN2,COLUMN3
ORDER BY COLUMN1, COLUMN2,COLUMN3 ASC ) = 1;
DROP TABLE OLD_TABLE;
RENAME NEW_TABLE TO OLD_TABLE;

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you set the session mode parameters in bteq?

602


What are the primary characteristics of the Teradata.

582


How do you see a ddl for an existing table?

567


What are the main components of teradata system?

578


Highlight the need for Performance Tuning.

578






Explain teradata architecture in detail with a diagram.

607


What are the functions involved in shared information architecture?

598


How teradata makes sure that there are no duplicate rows being inserted when its a set table?

553


What are the steps involved in the process flow of the sql statement through channel attached system?

653


What is a sparse index?

622


What is the difference between global temporary tables and volatile temporary tables?

629


There is a column with date in it. If I want to get just month how it can be done? Can I use sub string?

627


how many modules are there in telecome domain?how to explain the architecture?

1551


Explain the term 'columns' related to relational database management system?

546


What is bteq utility in teradata?

565