a表
idb表
id
equimentid现在我想找到b表中equimentid=c119的ID与a表中ID相同的集合,下面的是我写的.在SQL2000里面老是说where 附近有语法错误.请帮忙!select a.id from a , (select b.id from b where b.equimentid = 'C119') where a.id = b.id

解决方案 »

  1.   

    out_main.id from out_main , out_detail where out_main.id = out_detail.id and out_detail.equimentid = 'C119'
      

  2.   

    select b.id,b.equimentid from b inner join a on b.id=a.id  where b.equimentid = 'C119'^_^
      

  3.   

    Select id, equimentid 
    From b 
    Where equimentid ='C119' and id in (Select id From a)
      

  4.   

    select a.id from a , (select b.id from b where b.equimentid = 'C119')as b where a.id = b.id
      

  5.   

    select b.id,b.equimentid from b inner join a on b.id=a.id  where b.equimentid = 'C119'
    这样就行了,!
      

  6.   

    要不这样
    select b.id,b.equimentid from b,a where a.id=b.id and b.equimentid='cll9'
    去试一下吧,偶没试,但偶认为这样也行的!
      

  7.   

    select a.id from a where a.id in (select b.id from b where b.equimentid='c119')
      

  8.   

    select a.id from a , (select b.id from b where b.equimentid = 'C119') c where a.id = c.id