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
What is posting?
Do triggers have restrictions on the usage of large datatypes, such as long and long raw?
what are the advantages and disadvantages of views in a database? : Sql dba
What are the two types of periodical indexes?
What is sql partition?
Can function return multiple values in sql?
What is difference between stored procedure and trigger?
how to create a new table in mysql? : Sql dba
what is bcp? When does it used? : Sql dba
Explain mutating table error.
Does a primary key have to be a number?
what is a relationship and what are they? : Sql dba
What is sqlservr exe?
What is pivot query?
What is oracle sql developer?