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 dimensional modeling?
Why is the case expression used in teradata?
Mention the procedure via which, we can run Teradata jobs in a UNIX environment.
Explain the meaning of Amp?
What is stored procedure in teradata?
How do you set the session mode parameters in bteq?
What is the purpose of joins in teradata and what are the available join types?
What do high confidence, low confidence and no confidence mean in explain plan?
Explain teradata utilities. What is multiload, fast load, tpump?
Explain vproc in teradata?
Highlight a few of the important components of Teradata?
Why does varchar occupy 2 extra bytes?
Backup Script was blocked then you are unable to archive the data. how do you analyze it and where do you identify ?
What are types of partition primary index (ppi) in teradata?
What are the functions performed by bynet?