table1                             table2
col1  col2   col3                  col1   col2   col3 
ID    Name                         ID     Name将所有table2 中col2  = table1 中 col2 的 col1 更新table1 中的col1 中 

解决方案 »

  1.   


    update table2 
    set col2 = table1.col2
    from table2  inner joion table1 
    on table2.id = table1.id and table2.name = table1.name
      

  2.   

    update t set t.col1=t2.col1
    from table1 t 
    join table2 t2 on t1.col2=t.col2
      

  3.   

    table1 table2
    这两个表的ID有关系吗?
      

  4.   

    update b set b.col1=a.col1
    from table1 a
    join table2 b 
    on a.col2=b.col2
      

  5.   

    消息 4104,级别 16,状态 1,第 1 行
    无法绑定由多个部分组成的标识符 "b.ContructionID"。出了个错不知道为什么
      

  6.   

    update table2  set col1=a.col1
    from table1 a
    join table2 b 
    on a.col2=b.col2
      

  7.   

    表名没有错 , 但是依然是出现
    消息 4104,级别 16,状态 1,第 1 行
    无法绑定由多个部分组成的标识符 "b.col1"。不知道是为什么 ~
      

  8.   

    update 南京数据导入201007 set b.ContructionID=a.ConstructionID
    from 南京数据导入201007 b join WUPublic.dbo.Construction a  
    on a.ConstructionName=b.ConstructionName