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

Hope this will help,

DELETE FROM EMPLOYEE
WHERE (EMP_ID,EMP_NAME) IN
(SELECT EMP_ID,EMP_NAME FROM
(SELECT EMP_ID,EMP_NAME ,ROW_NUMBER() OVER (PARTITION BY
EMP_ID,EMP_NAME ORDER BY EMP_ID,EMP_NAME) AS FLG
FROM EMPLOYEE) A
WHERE
A.FLG<>1)

Is This Answer Correct ?    4 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain and compare pros and cons of snow flake schemas?

605


What are different table types used in teradata?

580


What are some commonly used bteq scripts?

563


What is difference between user and database in teradata?

611


How many sessions of MAX is PE capable of handling at a particular time?

587






What is the use of stored procedures in teradata?

560


What are the enhanced features in teradata v2r5 and v2r6?

684


If Fast Load Script fails and only the error tables are made available to you, then how will you restart?

631


What is the difference between teradata and oracle?

551


What type of indexing mechanism do we need to use for a typical data warehouse?

608


What is inner join and outer join?

611


Highlight the need for Performance Tuning.

578


Can you connect multiload from ab initio?

637


How do you do backup and recovery in teradata?

540


What are the uses of bynets in multi-node systems?

582