select *
from 表1 a,表2 b1,表2 b2
where a.字段1=b1.id and a.字段2=b2.id

解决方案 »

  1.   

    like this?
    select a.col=b.col,a.col2=b.col2
    from a,b
    where a.id=b.idselect a.col=b.col,a.col2=b.col2
    from a
    inner join b
    on a.id=b.id
      

  2.   

    不好意思.请看:A表中有:a b c d
    B表中有:t f我是想:
    1、A表中的b与B表中的t关联,并显示f
    2、A表中的c与B表中的t关联,并显示f
    3、A表中的d与B表中的t关联,并显示f
    用一条语句完成.
      

  3.   

    select a.*,b1.f,b2.f,b3.f
    from A
      left join B b1 on a.b=b1.t
      left join B b2 on a.c=b2.t
      left join B b3 on a.d=b3.t
      

  4.   

    可以多次联接这个表,起不同的别名就行了。
    select * from aaa a
      inner join bbb b1 on a.id1=b1.id1
      inner join bbb b2 on a.id2=b2.id2
      

  5.   

    select *
    from 表1 a,表2 b1,表2 b2,...
    where a.字段1=b1.id and a.字段2=b2.id and ....