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
Explain the term 'foreign key' related to relational database management system?
how many modules are there in telecome domain?how to explain the architecture?
Explain PDE.
how can we analyze the locks ?
What are the various indexes in teradata? How to use them?
How many codd's rules are satisfied by teradata database?
What is multi insert?
What are the functions of a Parser?
What are the main components of teradata system?
What do high confidence, low confidence and no confidence mean in explain plan?
What does sleep function does in fast load?
What is called partitioned primary index (ppi)?
What is upsert statement in teradata?
if collect stats but it show low confidence why?
My table got locked during mload due to a failed job. What do I do to perform other operations on it?