22,210
社区成员
发帖
与我相关
我的任务
分享
select
*
from
@table t
where
exists(select 1 from @table where bundle=t.bundle and [section]<>t.[section])
select * from @table as A
where exists(select 1 from @table where bundle=A.bundle group by bundle having count(distinct section)>1)
select *
from @table t
where exists(select 1 from @table where bundle=t.bundle and [section]!=t.[section])
SELECT * FROM tb AS A
WHERE EXISTS(SELECT * FROM tb
WHERE bundle = A.bundle AND section <> A.section
AND A.id <> id)