update a set a.x=b.mc from a,b where b.mc like where b.mc like '%' +a.mc+'%'
前提必须保证找到的b.mc只有一个。否则要报错。

解决方案 »

  1.   


    update a set... from a,b where b.mc=a.mc
      

  2.   

    update a set ....
    where b.mc like '%' +(select top 1 mc from a)+'%'或
    update a set ....
    where b.mc like '%' +(select max(mc )from a)+'%'
      

  3.   

    有两个表A,B,想用B表中符合A表条件的数据更新A表数据,
    update a set a.mc=b.mc ,....
    from b where charindex(a.mc,b.mc)>0
      

  4.   

    有两个表A,B,想用B表中符合A表条件的数据更新A表数据,
    update a set a.mc=b.mc ,....
    from b where charindex(a.mc,b.mc)>0