s1 只供应了 P1,P2两种零件吗?
select jno from spj
where pno in ('p1','p2')
group by jno
having count(*)=2
如果S1提供的零件没有明确说明:
select jno from spj
where pno in (select pno from spj where sid='s1')
group by jno
having count(*) = (select count(*) from spj where sid='s1' group by sid)
=====以上均测试通过(虽然不是很简洁 我再研究一下)=====
select JNO from [表] where sno='s1'
select jno from tableName where sno='s1' and jno in (select jno from tablename where sno='s1')
S1所供应的全部零件 包括什么?
select * from [表] where sno='s1'
其他复杂查询可以给我发信息 我能帮你