56,687
社区成员
发帖
与我相关
我的任务
分享
select distinct k.sno
from tb k join(
select b.sno
from (select * from tb where sno=1) t left join tb b on t.sno<>b.sno and t.gno=b.gno
where b.gno is null) z
on k.sno<>z.sno
select distinct sno
from tb a
where not exists (
select 1 from tb
where sno=3
and gno not in (select gno from tb where sno=a.sno)
)