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
What is meant by a Clique?
What are the functions of a Parser?
What are the string manipulation operators and functions associated with teradata?
Explain the advantages of partitioned primary index in a query?
What is logical data model?
What is the use of teradata system software?
What are the various indexes in teradata? How to use them? Why are they preferred?
Explain the parallel data extension in teradata?
how can we analyze the locks ?
What is a level of granularity of a fact table?
Let us say there is a file that consists of 100 records out of which we need to skip the first and the last 20 records. What will the code snippet?
What is the basic syntax for teradata select statement?
How teradata makes sure that there are no duplicate rows being inserted when its a set table?
What are the available primary index types in teradata.
How many codd's rules are satisfied by teradata database?