I currently have a table called People. Within this table there are thousands of rows of data which follow the below layout:
gkey | Name | Date | Person_Id
1 | Fred | 12/05/2012 | ABC123456
2 | John | 12/05/2012 | DEF123456
3 | Dave | 12/05/2012 | GHI123456
4 | Fred | 12/05/2012 | JKL123456
5 | Leno | 12/05/2012 | ABC123456
If I execute the following:
SELECT [PERSON_ID], COUNT(*) TotalCount
FROM [Database].[dbo].[People]
GROUP BY [PERSON_ID]
HAVING COUNT(*) > 1
ORDER BY COUNT(*) DESC
I get a return of:
Person_Id | TotalCount
ABC123456 | 2
Now I would like to remove just one row of the duplicate values so when I execute the above query I return no results. Is this possible?