SELECT
result.no,user.*
FROM
(
SELECT
no,
count(*) AS count
FROM
user
GROUP BY
no
HAVING
count > 1
) AS result
LEFT JOIN user ON user.no = result.no
mysql某个字段重复查询出来
最新推荐文章于 2024-08-22 20:42:12 发布
SELECT
result.no,user.*
FROM
(
SELECT
no,
count(*) AS count
FROM
user
GROUP BY
no
HAVING
count > 1
) AS result
LEFT JOIN user ON user.no = result.no