我现在只想从几千条记录中选择计数大于 1 的行(即重复项)
SELECT count( * ) AS `Number` , GI . *
FROM `GeneralInformation` AS GI
GROUP BY `FirstName` , `Surname`
我怎样才能做到这一点?
SELECT count( * ) AS `Number` , GI . *
FROM `GeneralInformation` AS GI
GROUP BY `FirstName` , `Surname`
HAVING count(*)>1
使用 Have 子句
SELECT count( * ) AS `Number` , GI . *
FROM `GeneralInformation` AS GI
GROUP BY `FirstName` , `Surname`
HAVING count( * ) > 1