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 function and procedure?
define join and explain different type of joins? : Sql dba
What is difference between hql and native sql?
How do I tune a sql query?
How to set up sql*plus output format in oracle?
How do I order by ascending in sql?
Does sql profiler affect performance?
How to use boolean type in select statement?
How to move files from one directory to another in pl sql?
how to start mysql server? : Sql dba
what is the difference between truncate and drop statements? : Sql dba
Why is there a need for sqlcode and sqlerrm variables?
what is recursive stored procedure? : Sql dba
What is the process of debugging?
Are pl sql variables case sensitive?