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...

how do you count the duplicate records in a table

Answer Posted / babu

Try this,
select col1,count(col1) from tab1
group by col1 having count(col1)>1;

If you want to delete these duplicate entries, use:
delete from tab1 where col1 in (select a.col1 from
(select col1,count(col1) from tab1
group by col1 having count(col1)>1) a);

Is This Answer Correct ?    18 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are hotfixes and patches?

956


What is the meaning of disabling a trigger?

1191


how to write date and time literals? : Sql dba

974


When you have to use a default "rollback to" savepoint of plvlog?

1211


what is the difference between rownum pseudo column and row_number() function? : Sql dba

1096


What is sql lookup?

935


what are integrity rules?

1042


What is a natural join sql?

997


Which command is used to delete a package?

1180


how many ways we can we find the current date using mysql? : Sql dba

1109


What is posting?

1042


how to add a new column to an existing table in mysql? : Sql dba

1085


How do you explain an index number?

1118


How do I run sql profiler?

1080


What is int identity in sql?

1153