A           B2           <NULL>
3           <NULL>
4           <NULL>
2           <NULL>
34           <NULL> 将B字段 变成跟A字段一样的数值,求最简短的短句。

解决方案 »

  1.   

    update 表 set b=a 
      

  2.   

    update tb set B=A
      

  3.   

    update tb set b=a 
      

  4.   


    Declare @t table(A varchar(10),B varchar(10))
    Insert @t
    Select '2',NULL union all
    Select '3',NULL union all 
    Select '4',NULL union all
    Select '2',NULL union all 
    Select '34',NULL Update @t Set b=a
    /*
    A          B
    ---------- ----------
    2          2
    3          3
    4          4
    2          2
    34         34(5 行受影响)
    */
      

  5.   

    update table set B=A