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 / nunna
Query to find duplicates in a table:(Custname, Prod,
Order_amt)
select custname,count(*) from sales1 a where a.rowid > ANY
(select b.rowid from sales1 b where a.custname=b.custname
and a.prod=b.prod and a.order_amt=b.order_amt) group by
custname;
Query to delete duplicates:
delete from sales1 a where a.rowid > ANY (select b.rowid
from sales1 b where a.custname=b.custname and a.prod=b.prod
and a.order_amt=b.order_amt);
| Is This Answer Correct ? | 7 Yes | 15 No |
Post New Answer View All Answers
Differentiate primary key and partition key?
What is the use of fallback?
What is meant by Teradata Gateway?
What is a sparse index?
What are the various reporting tools in the market?
Mention a few of the ETL tools that come under Teradata.
What do you mean by teradata sql assistant?
What are the advantages of teradata?
What are some primary characteristics of teradata?
What is the use of teradata system software?
What are the uses of client software involved in teradata?
If I wanted to run a TPump job only once per day - basically working on a file that is produced once per day - how would you set up the parameters for that sort of job ?
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
What is the purpose of joins in teradata?
What are default access rights in teradata?