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 are hotfixes and patches?
What is the meaning of disabling a trigger?
how to write date and time literals? : Sql dba
When you have to use a default "rollback to" savepoint of plvlog?
what is the difference between rownum pseudo column and row_number() function? : Sql dba
What is sql lookup?
what are integrity rules?
What is a natural join sql?
Which command is used to delete a package?
how many ways we can we find the current date using mysql? : Sql dba
What is posting?
how to add a new column to an existing table in mysql? : Sql dba
How do you explain an index number?
How do I run sql profiler?
What is int identity in sql?