select * from table2 where 
field(1) in (select field(0) from table1 where field(1)=1) and
field(2) in (select field(0) from table1 where field(1)=2) and
field(3) in (select field(0) from table1 where field(1)=3)

解决方案 »

  1.   

    这样写会好点
    select * from table2 where 
    table2.field(1) in (select table1.field(0) from table1 where table1.field(1)=1) and
    table2.field(2) in (select table1.field(0) from table1 where table1.field(1)=2) and
    table2.field(3) in (select table1.field(0) from table1 where table1.field(1)=3)
      

  2.   

    确实很难啊!
    select * from table2 where 
    table2.field(1) in (select table1.field(0) from table1 where table1.field(1)=1) and
    table2.field(2) in (select table1.field(0) from table1 where table1.field(1)=2) and
    table2.field(3) in (select table1.field(0) from table1 where table1.field(1)=3) 
    这个语句不适合table1中记录未知的情况。