判断字段是否存在重复数据

select code from bd_psndoc c where c.code in(select c.code from bd_psndoc c group by c.code having count(*)>1)

原文地址:https://www.cnblogs.com/zs-chenkang/p/13187515.html