求至少用了供应商 Sl 所供应的全部零件的工程号 JNO ;
Select jno from 
spj spjx 
where not exists(
select * from spj spjy 
where spjy.sno=’s1’ and not exists(
select * from spj spjz where 
spjz.sno=spjy.sno and 
spjz.pno=spjy.pno))请问这里为什么要定义第三个变量spj spjz  
不能直接用spjx来代替吗?

解决方案 »

  1.   


    为什么要定义spjz   这个别名,直接用spjx不行吗?
      

  2.   

    求至少用了供应商 Sl 所供应的全部零件的工程号 JNO ;
    Select jno from  
    spj spjx  
    where not exists(
    select * from spj spjy  
    where spjy.sno=’s1’ and not exists(
    select * from spj spjz where  
    spjz.sno=spjx.sno and  
    spjz.pno=spjy.pno))请问这里为什么要定义第三个另名spj spjz   
    不能直接用spjx来代替吗?改成这样子select * from spjx where  
    spjx.pno=spjy.pno
      

  3.   

    不行的  select了三次表 就要有三个不同的别名来分别指代你引用的是哪个表中的pno列