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
How many indexes can be created on a table in sql?
what are string data types? : Sql dba
How can check sql version from command line?
How do we use distinct statement? What is its use?
What is the current version of postgresql?
Why is normalization important?
What is union and union all keyword in sql and what are their differences?
What is rowtype?
what are set operators in sql? : Sql dba
Explain the steps needed to create the scheduled job?
What is optimistic concurrency control? : Transact sql
Can we create table inside stored procedure?
Is there a 64 bit version of ssms?
Is progress software supports to ( pl/sql )?
Is oracel sql developer written in java?