update table1 
set table1.car=table2.car
from table2
where table1.name=table2.name and table2.car = '宝马'if name is the key

解决方案 »

  1.   

    Update Table1 Set Table1.Car=Table2 from Table1 Inner join Table2 on Table1.Name=Table2.Name where Table1.Name in (Select Name from Table2  Group by Name Having Count(Car)=1)
      

  2.   

    如:表1
    姓名   车辆
    aaa
    bbb表2
    姓名   车辆
    aaa    宝马
    bbb    宝马
    bbb    红旗现在想把表1更新为
    表1
    姓名   车辆
    aaa    宝马
    bbb    怎么办?
      

  3.   

    Tongls(编程杀手) 的就是对的,还问什么呀!!
      

  4.   

    update table1 
    set table1.car=table2.car
    from table2
    where table2.name in (select name from table2 group by name having count(*)=1) 
          and table1.name=table2.name