Link to home
Start Free TrialLog in
Avatar of tommym121
tommym121Flag for Canada

asked on

SQL - How to count duplicate record

I have a table with firstName, lastName and other fields,  I will like to count all the rows have the same firstName and lastName.
Avatar of Anuroopsundd
Anuroopsundd
Flag of India image

SELECT firstname, lastname, COUNT(*)  FROM person  GROUP BY firstname, lastname  HAVING COUNT(*) > 1;
Avatar of Anthony Perkins
Something like this perhaps:
SELECT COUNT(DISTINCT firsname + lastname)
FROM YourTable
ASKER CERTIFIED SOLUTION
Avatar of Deepak Chauhan
Deepak Chauhan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tommym121

ASKER

Thanks