查询表1里面fid=1的有多条,查询表2条件是uid=表1里面uid的值,得到的结果是:
表1fid=1和表2uid=表1uid的值。这样的sql语句怎么写。

解决方案 »

  1.   

    select *from A as a,B as btabale where a.fid=1 and a.uid=b.uid;你看这样行不行
      

  2.   

    select t1.a, t2.b from t1 left join t2 on  t1.uid = t2.uid where t1.fid = 1select t1.a, t2.b from t1, t2 where t1.fid = 1 and t1.uid = t2.uid
      

  3.   

    select t1.*, t2.* from t1, t2 where t1.fid = 1 and t1.uid = t2.uid
      

  4.   

    select * from t1 as a, t2 as b where a.fid = 1 and a.uid = b.uid