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 are the frequently used data types in teradata?

1130


What do you mean by ttu in teradata?

1081


What are the things to be considered while creating secondary index?

1140


What are different table types used in teradata?

1092


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

1997


if collect stats but it show low confidence why?

1747


What is meant by a Clique?

1111


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

1097


What is dimensional modeling?

1137


what is sysdba and sysdbc ? which has high priority ?

3882


In BTEQ, how are the session-mode parameters being set?

1189


Explain parsing engine in teradata?

1138


What are the updated features of teradata?

1087


Explain the advantages of partitioned primary index in a query?

1069


How can bottlenecks be identified?

1058