用where语句:
where a表.col字段 = b表.col字段

解决方案 »

  1.   

    select a.fid,a.faa,a.fbb,b.fcc,b.fdd from aa a inner join bb b on a.fid=b.fid
    MS推荐方法
    在不同标准里确实有几种方法,如果你用MS SQL SERVER,还是建议你用上面这种方法
      

  2.   

    select * from A inner join B on A.id=B.id
    select * from A left join B on A.id=B.id
    select * from A right join B on A.id=B.id
      

  3.   

    select * from table1 a,table2 b where a.id=b.id
    等价于
    select * from table1 a inner join table2 b on a.id=b.id以左边的表为准,进行外联接!
    select * from table1 a left join table2 b on a.id=b.id
    此时如果在table1表中有的id而在table2表中没有,那么就会以NULL表示