mysql 统计重复记录数量
SELECT COUNT(*) as total FROM (
SELECT count(openid) as t
FROM user
GROUP BY `openid`
HAVING t > 1 limit 1000
) as a
如果下面写法会很慢
SELECT COUNT(*) as total FROM form_user WHERE id IN(
SELECT count(id)
FROM form_user
GROUP BY `openid`
HAVING COUNT(openid) > 1 limit 1000
)
最后更新于 2019-03-19 09:39:22 并被添加「mysql 统计重复记录数量」标签,已有 714 位童鞋阅读过。
此处评论已关闭