美文网首页
【MySQL】查询重复数据

【MySQL】查询重复数据

作者: 嗖嗖编程 | 来源:发表于2020-03-02 17:51 被阅读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
    

    相关文章

      网友评论

          本文标题:【MySQL】查询重复数据

          本文链接:https://www.haomeiwen.com/subject/ddfbkhtx.html