how do you count the duplicate records in a table

Answer Posted / sravan

Hi here is another way to solve this

SELECT NAME, COUNT(NAME) FROM TABLE_NAME
WHERE NAME IN (SELECT NAME FROM TABLE_NAME
GROUP BY NAME
HAVING COUNT(NAME)>1)
GROUP BY NAME;

thanks

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which sql most popular?

728


What is pessimistic concurrency control? : Transact sql

831


What operating systems are supported by oracle sql developer?

714


How do you delete data from a table?

735


What is sql prepared statement?

738






What is left join in postgresql?

750


Can we create a trigger on view?

668


What do you mean by field in sql?

787


What are triggers and its types?

755


How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?

868


What is nosql db?

712


Explian rowid, rownum? What are the psoducolumns we have?

759


Explain the commit statement.

848


How are sql commands classified?

803


What is the purpose of using pl/sql?

830