select * from TableName as out where exists(select * from (select DiaID from TableName group by DiaID having count(*) > 1) as b where DiaID = out.DiaID)
正解 select distinct * from TableName as out where exists(select * from (select DiaID from TableName group by DiaID having count(*) > 1) as b where DiaID = out.DiaID) 试试
where exists(select * from
(select DiaID from TableName group by DiaID having count(*) > 1) as b
where DiaID = out.DiaID)
正解
select distinct * from TableName as out
where exists(select * from
(select DiaID from TableName group by DiaID having count(*) > 1) as b
where DiaID = out.DiaID)
试试