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 is function and procedure?

1078


define join and explain different type of joins? : Sql dba

1002


What is difference between hql and native sql?

1238


How do I tune a sql query?

1043


How to set up sql*plus output format in oracle?

1082


How do I order by ascending in sql?

1081


Does sql profiler affect performance?

1048


How to use boolean type in select statement?

1139


How to move files from one directory to another in pl sql?

1254


how to start mysql server? : Sql dba

1239


what is the difference between truncate and drop statements? : Sql dba

1183


Why is there a need for sqlcode and sqlerrm variables?

1104


what is recursive stored procedure? : Sql dba

1028


What is the process of debugging?

1129


Are pl sql variables case sensitive?

1093