sábado, 1 de marzo de 2008

Obtener los códigos de los proyectos a los cuales suministren partes todos y cada uno de los proveedores que suministren alguna parte roja.

Select Distinct J#
from SPJ, SPJX
where not exists (select *
from SPJ SPJY
where exists (select *
from SPJ SPJA
where SPJA.S# = SPJY.S#
and SPJA.P# in (select P#
from P
where color = ‘Rojo’)
and not exists (select *
from SPJ SPJB
where SPJB.S# = SPJY.S#
and SPJB.J# = SPJX.J#)));

No hay comentarios: