SELECT * from TBCITY_Temp
where code in ( select code from TBCITY_Temp group by code having count(code) > 1 ) and AutoId not in ( select min(AutoId) from TBCITY_Temp group by code having count(code)>1)-- 条件为code再重复数据里,and Id 不是最小的
本文共 283 字,大约阅读时间需要 1 分钟。
SELECT * from TBCITY_Temp
where code in ( select code from TBCITY_Temp group by code having count(code) > 1 ) and AutoId not in ( select min(AutoId) from TBCITY_Temp group by code having count(code)>1)-- 条件为code再重复数据里,and Id 不是最小的
转载于:https://www.cnblogs.com/chengeng/p/4446921.html