我目前有一张名为 People 的表。在此表中,有数千行数据,其布局如下:
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
如果我执行以下操作:
SELECT [PERSON_ID], COUNT(*) TotalCount
FROM [Database].[dbo].[People]
GROUP BY [PERSON_ID]
HAVING COUNT(*) > 1
ORDER BY COUNT(*) DESC
我得到回报:
Person_Id | TotalCount
ABC123456 | 2
现在我想只删除一行重复值,所以当我执行上述查询时,我不会返回任何结果。这可能吗?