【MySQL】查询重复数据

2020-03-02  本文已影响0人  嗖嗖编程
SELECT * FROM
(
    SELECT
            openid,
            count(*) AS count
    FROM
            user
    GROUP BY
            openid
    HAVING
            count > 1
) AS result
LEFT JOIN user u ON u.openid = result.openid
ORDER BY result.openid DESC
上一篇下一篇

猜你喜欢

热点阅读