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
What is smp and mpp platforms?
Highlight the limitations of TPUMP Utility.
Explain the new features of teradata?
How to Extract data from multiple legacy systems?
While creating table my dba has fallback or no fallback in his ddl. What is that?
What is the multi-insert?
How can bottlenecks be identified?
What are the string manipulation operators and functions associated with teradata?
how do you manage the production space. what are the proactive methods you can take ?
Difference between multiload and tpump?
How would you load a very large file in teradata in general?
How is MLOAD Teradata Server restarted after execution?
Explain vproc in teradata?
How will you solve the problem that occurs during update?
What are the frequently used data types in teradata?