sábado, 1 de marzo de 2008

Obtener los códigos de los proyectos tales que al menos cierta cantidad de cada parte utilizada por ellos le sea suministrada por el proveedor S1.

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

No hay comentarios: