Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is dimensional modeling?

1088


Why is the case expression used in teradata?

1079


Mention the procedure via which, we can run Teradata jobs in a UNIX environment.

994


Explain the meaning of Amp?

1155


What is stored procedure in teradata?

1033


How do you set the session mode parameters in bteq?

1108


What is the purpose of joins in teradata and what are the available join types?

1088


What do high confidence, low confidence and no confidence mean in explain plan?

1048


Explain teradata utilities. What is multiload, fast load, tpump?

1009


Explain vproc in teradata?

1008


Highlight a few of the important components of Teradata?

1030


Why does varchar occupy 2 extra bytes?

1198


Backup Script was blocked then you are unable to archive the data. how do you analyze it and where do you identify ?

1956


What are types of partition primary index (ppi) in teradata?

1056


What are the functions performed by bynet?

1043