select a.username name, b.userinfo info from table_a a,table_b b where conditions……and Join left on / Join right on……

解决方案 »

  1.   

    select a.table_id,b.table_id from table1 a,table2 b where a.class='数据' and b.class='数据'
    在这两张表里面有许多相同的字段,我想把表里的所有记录都取出来,两张表里都有class字段,我想根据这个条件来取,该怎么写
      

  2.   

    追风好文章 >> left join/right join/inner join操作演示 >> http://redea.net/gbmad/body/ShowTopic.asp?id=420
    看看这个也许行……
      

  3.   

    在这两张表里面有许多相同的字段,我想把表里的所有记录都取出来,两张表里都有class字段--------------------------------
    I don't understand what you mean...
      

  4.   

    假设a 表 (fa1,fa2,fclass)
    假设b 表 (fb1,fb2,fclass)
    SELECT fa1 as a ,fa2 as b,fclass as c FROM a UNION ALL SELECT fb1 as a ,fb2 as b,fclass as c FROM b;
      

  5.   

    找出两表你想要关连的字段,连起来查询.
    比如一个:
    select a.a1,a.a2,b.b1,b.b2 from a,b where a.a1=b.b1;
    需求不同,语句不同.