如何update 表1的字段B='aa',字段c='bb',当表1字段A的值=表2字段A的值

解决方案 »

  1.   

    update 表1 set  字段B='aa',字段c='bb'  from 表2 where 表1字段A的值=表2字段A的值
      

  2.   


    update tb1 
    set b = 'aa' , c = 'bb'
    from tb1 , tb2 
    where tb1.a = tb2.a
      

  3.   

    UPDATE A SET
        字段B='aa',
        字段C='bb'
    FROM tb1 AS A
        JOIN tb2 AS B
           ON A.字段A=B.字段A
      

  4.   

    我觉得这样就可以了
    不用再在from里面 把"表1"再列出来.
    我一直都这么用的
      

  5.   


    update tb1
    set B='BB',C='CC'
    from tb2 
    where tb1.A=tb2.A
      

  6.   

    update table1
    set 
       B='BB',
       C='CC'
    from table1 join table2
    on table1.A = table2.A
      

  7.   

    update a set
        字段b='aa',
        字段c='bb'
    where a.字段a 
    in 
    (select 字段a from b)
      

  8.   

    update tb1 
    set b = 'aa' , c = 'bb'
    from tb1 , tb2 
    where tb1.a = tb2.a