查询某个字段有重复的数据:
select org_id from oa_food_yy group by org_id having count(*)>1
查询某些字段有重复的数据:
select org_id,food_id from oa_food_yy group by org_id,food_id having count(*)>1
select * from oa_food_yy where (org_id,food_id) in (select org_id,food_id from oa_food_yy group by org_id,food_id having count(*)>1)
原文地址:https://www.cnblogs.com/GodSince/p/10950536.html
时间: 2024-10-01 21:35:48