Link to home
Start Free TrialLog in
Avatar of mgordon-spi
mgordon-spi

asked on

SQL Statement - Can't add ID

I have a statement that counts occurrences of a combined field. I need the ID number of each of those rows.
SELECT    sFirstName + ' ' + sLastName AS Contacts, COUNT(sFirstName + ' ' + sLastName) AS NumOccurrences
FROM         tContacts
GROUP BY sFirstName + ' ' + sLastName
HAVING      (COUNT(sFirstName + ' ' + sLastName) > 1)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg 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
What is your SQL Server version?
Avatar of mgordon-spi
mgordon-spi

ASKER

That was great, thank you very much..