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

What is a natural join?

514


what is the difference between delete and truncate statement in sql? : Sql dba

546


What is the sql*loader? : aql loader

585


Can unique keys be null?

484


List out the acid properties and explain?

560






what is sql server agent? : Sql dba

599


How do you write a complex sql query?

585


Explain the purpose of %type and %rowtype data types with the example?

549


Can 2 queries be executed simultaneously in a distributed database system?

640


What is column?

548


What is pl sql block structure?

539


Is there a 64 bit version of ssms?

516


What is a left join?

507


what are the maximum number of rows that can be constructed by inserting rows directly in value list? : Transact sql

498


How long it takes to learn pl sql?

531