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 posting?

986


Do triggers have restrictions on the usage of large datatypes, such as long and long raw?

1111


what are the advantages and disadvantages of views in a database? : Sql dba

993


What are the two types of periodical indexes?

884


What is sql partition?

1035


Can function return multiple values in sql?

982


What is difference between stored procedure and trigger?

1055


how to create a new table in mysql? : Sql dba

932


what is bcp? When does it used? : Sql dba

932


Explain mutating table error.

1127


Does a primary key have to be a number?

915


what is a relationship and what are they? : Sql dba

1018


What is sqlservr exe?

940


What is pivot query?

1013


What is oracle sql developer?

986