Mysql查询某字段值重复的数据

select accountid,count(*) as count from vtiger_assetaccount  group by accountid having count>1;

 更新

如果要找出是哪些记录重复

SELECT
	result.accountid
FROM
	(
		SELECT
			accountid,
			count(*) AS count
		FROM
			vtiger_assetaccount
		GROUP BY
			accountid
		HAVING
			count > 1
	) AS result
LEFT JOIN vtiger_assetaccount ON vtiger_assetaccount.accountid = result.accountid
原文地址:https://www.cnblogs.com/anxiaoyu/p/8637410.html