必要なのは、単純なコッドの関係分割です。
select distinct p.team from player p
where not exists
(select * from player p1
where not exists
(select * from player p2
where
p.team=p2.team
and
p2.gid=p1.gid))
必要なのは、単純なコッドの関係分割です。
select distinct p.team from player p
where not exists
(select * from player p1
where not exists
(select * from player p2
where
p.team=p2.team
and
p2.gid=p1.gid))