select * from t_a*里面有NN多字段,但是其中有一项id指向的员工名称,必须从t_b表获得,t_a表里面保存的只是1,2,3,4,请问应该怎么写?

解决方案 »

  1.   

    select *,b.员工名称 from t_a a,t_b b
    where a.id=b.id
      

  2.   

    select a.*,b.name from t_a a join t_b b on a.id=b.id
      

  3.   

    select t_a.* inner join t_b.员工名称
    on t_b.id=t_a.id
      

  4.   

    SELECT * FROM T_A
    INNER JOIN T_B ON T_A.ID=T_B.ID
      

  5.   


    select 
         a.*,b.员工名称 
    from 
         t_a a,t_b b 
    where 
         a.id=b.id 
      

  6.   


    select b.name, a.*
    from t_a a inner join t_b b 
    on a.id=b.id
      

  7.   


    --抄袭版
    select b.name, a.*
    from t_a a inner join t_b b 
    on a.id=b.id