mysql查询某个字段中是否有重复的值
方法一
SELECT *
FROM (
SELECT `openid` , COUNT( * ) AS c
FROM ing_jf_shop
GROUP BY `openid`
FROM ing_jf_shop
GROUP BY `openid`
)t
WHERE c >1
方法二
SELECT openid ,
COUNT(openid)
FROM ing_jf_shop
GROUP BY openid
HAVING COUNT(openid) > 1
-- ing_jf_shop 是表名
-- openid 是要确定是否有重复值的字段