我要提取出三个表里面的每个字段,如A,B,C 表 公共字段为 P_ID  我要提取每个表里面的数据该怎么写呢?我按照sql的语法写显示报错!!!
在线求解!!!

解决方案 »

  1.   

    select a.*,b.*,c.*
    from a,b,c
    where a.p_id = b.p_id
    and b.p_id = c.p_id
      

  2.   


    解决了,哈哈,去掉了那个left join 和On
      

  3.   


    select a.*, b.*, c.*
      from a, b, c
     where a.p_id = b.p_id
       and b.p_id = c.p_id
      

  4.   

    http://blog.csdn.net/BOBO12082119/archive/2011/03/11/6240244.aspx
      

  5.   

    如果不涉及到统计方面的内容,并且内容不多的话,还是不要使用join的好。反正咱使用left join都是因为需要使用聚合函数才用的。