mysql 筛选重复项(单列或者多列同时重复)mysql去重
原文:https://blog.csdn.net/luyaran/article/details/80929026
-------------单列-----------------------
SELECT
检查字段,
COUNT(检查字段)
FROM
table_name
GROUP BY 检查字段
HAVING COUNT(检查字段) > 1
-------------多列------------------
SELECT
检查字段1, COUNT(检查字段1),
检查字段2, COUNT(检查字段2),
...
FROM
table_name
GROUP BY
检查字段1,
检查字段2, ...
HAVING
(COUNT(检查字段1) > 1) AND
(COUNT(检查字段2) > 1) AND
看完打开支付宝扫一扫领个红包吧!