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 do you mean by stored procedures? How do we use it?
What is a nested table in word?
Can we write dml inside a function in sql server?
What is null in pl/sql?
Does user triggers have entry for trigger with compilation errors?
Are stored procedures compiled?
What is duration in sql profiler trace?
what is online transaction processing (oltp)? : Sql dba
What is a system versioned table?
What are the uses of merge?
What is the difference between rename and alias?
how can we destroy the session, how can we unset the variable of a session? : Sql dba
What has stored procedures in sql and how we can use it?
What is your daily office routine?
when MSQL8.0 is in market