select a_table.*,b_table.Bname from (select * from A where AID=100) as a_table,B as b_table where a_table.IDB=b_table.BID

解决方案 »

  1.   

    select a_table.*,b_table.Bname
    from A a_table,
         B b_table 
    where a_table.IDB=b_table.BID
      and a_table.AID=100
      

  2.   

    A表结构:AID(Key),IDB,Aname
    B表结构:BID(Key),Bnameselect a.aid,a.idb,a.aname,b.bname
    from a,b
    where a.idb=b.bid and a.aid = 100
      

  3.   

    select a.aid,a.idb,a.aname,b.bname from a left join b on a.idb=b.bid where a.aid=100
      

  4.   

    select a.*,b.bname 
    from a,b 
    where  a.idb=b.bid(+)
      and  a.aid=100
      

  5.   

    select 
    a.aid,
    a.idb,
    a.aname,
    b.bname
    from b 
    left join a
    on b.bid=a.idb
    and a.aid=100