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

How would you load a very large file in teradata in general? What utility would you use for it? Why?

1032


Explain the new features of teradata?

990


What is smp and mpp platforms?

900


if collect stats but it show low confidence why?

1618


What is difference between user and database in teradata?

1024


What are the 5 phases in a multiload utility?

984


How is MLOAD Client System restarted after execution?

1056


Explain teradata architecture in detail with a diagram.

1049


What is database exceptions in teradata?

894


What is a sparse index?

1022


What is the command in bteq to check for session settings ?

1115


What are default access rights in teradata? What explicit right can be given to a user?

1056


What are the main components of teradata system?

1066


What is spool space?

1074


What is the function of parser component in teradata?

1035