exec('alter table #tb add [签单] int')update t
set 签单=A.签单
from #tb t
join 数据一 A on A.区域=t.区域

解决方案 »

  1.   

    alter table table1 add  签单 int null
    update  #tb set 签单=a.签单
    from #tb left outer join (你的聚合函数的sql语句) as a on #tb.区域=a.区域
      

  2.   

    alter table #tb add  签单 int null
    update  #tb set 签单=a.签单
    from #tb left outer join (你的聚合函数的sql语句) as a on #tb.区域=a.区域
      

  3.   

    update t
    set 签单=A.签单
    from #tb t
    join 数据一 A on A.区域=t.区域
      

  4.   

    在语句 set 签单=a.签单 提示列名“签单”无效啊?不是已经在ALTER中插入了吗?