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
网友评论