首页 > 代码库 > 从数据表筛选重复的记录

从数据表筛选重复的记录

select s.id, t.*
from filelist as s
join (
select SensorId, FileName, count(*) as [count]
from filelist
group by SensorId, FileName
having count(*) > 1
) t on s.SensorId = t.SensorId and s.FileName = t.FileName

从数据表筛选重复的记录