1.字段下面查询重复的编号:
表结构:
select * from tab where 商品编码 IN ( SELECT 商品编码 FROM tab GROUP BY 商品编码 HAVING COUNT(*) > 1)
例如:SELECT *
FROM biangeng_zhifu_new
WHERE (ProMaterialNum IN
(SELECT promaterialnum
FROM biangeng_zhifu_new
GROUP BY promaterialnum
HAVING COUNT(*) > 1)) AND (CopContract = 'LXAQ2')