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 / bharath

guys rowid concept is discontinued in teradata as far as my
knowledge goes, we can always use below sql ...

INSERT INTO nodupes_table ( all_columns )
SELECT all_columns
FROM dupes_table
QUALIFY ...

where the QUALIFY ... can be (depending on your version):
/* V2R5 syntax */
QUALIFY ROW_NUMBER() OVER (PARTITION BY all_columns
ORDER BY all_columns) = 1

/* or V2R4 and higher equivalent functionality */
GROUP BY all_columns
QUALIFY CSUM(1, all_columns ) = 1

/* or, alternative OLAP SUM V2R4 and higher syntax */
QUALIFY SUM(1) OVER (PARTITION BY all_columns ORDER BY
all_columns ROWS
UNBOUNDED PRECEDING ) = 1


I do think an insert-select into a set table would be a
cleaner process (don't know about runtime, though):
INSERT INTO nodupes_set_table ( all_columns )
SELECT all_columns
FROM dupes_table;


refer to teradata forum for more info

Is This Answer Correct ?    17 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate database data and data warehouse data?

579


Explain Teradata performance tuning and optimization?

692


Highlight all the modes that are present under Confidence Level.

536


How to explain project Architecture and flow in teradata interviews?Can please anyone help on this? Am new to teradata.

3901


How to Extract data from multiple legacy systems?

570






Explain teradata architecture?

626


What is difference between user and database in teradata?

611


What is a node in teradata? Explain

597


What are the different design perspectives used in teradata?

543


Why teradata is used?

574


What is the particular designated level at which a LOCK is liable to be applied in Teradata?

595


In a table can we use primary key in one column and in another column both unique and not null constrains.if yes how?

569


What are the uses of client software involved in teradata?

532


i learn teradata,it is so intersting,now i want teradata certifications ,so any 1 help me to get teradata certifications TD 12 ? email:kdcrazyy@gmail.com

1761


If RDBMS is halted what will you do ?

1701