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

Why do we need unique key in a table?

942


how is exception handling handled in mysql? : Sql dba

1062


What is sql performance tuning?

903


what is cursor. write example of it. What are the attributes of cursor.

1366


What is difference between sql and excel?

1070


How to know the last executed procedure?

1071


What is $$ in sql?

974


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

1016


What is sql clause?

1035


What is a Mapplet?

1113


What is a file delimiter?

1070


What is sql profiler in oracle?

1070


How do you pronounce sql?

989


What are all the different types of indexes?

1127


differentiate between float and double. : Sql dba

1037