select *,(select state from table2 where table1.id=table2.id) from table1
试试

解决方案 »

  1.   

    呵呵,又来这里了:
    select * from table1 full join table2 on table1.id=table2.id
    or:
    select * from table1 left join table2 on table1.id=table2.id
      

  2.   

    select a.field1,a.field2..,b.field1,b.field2..from table1 a jion table1 b on a.field1 = b.field1
      

  3.   

    select * from table1 full join table2 on table1.id=table2.id
      

  4.   

    不用那么复杂吧
    select * from table1 full join table2 on table1.id *= table2.id就可以了
      

  5.   

    写错了
    select a.id,a.name,b.state from table1 a,table b where a.id *= b.id就可以了
      

  6.   

    select 列名,列名,[,列名]
    from 表名 left[right] outer join 表名
    on 
    表名.引用列名  连接操作符  表名.引用列名