tab1(
fld int,
fld1 int
)
tab2 
(
fld int ,
fld1 int
)我要将tab2中where tab1.fld = tab2.fld的都fld1字段值赋给tab1 fld1字段    
用Update set 应怎么写啊

解决方案 »

  1.   

    update tb1 set 
        fld1=tb2.fld1
    from tb2
    where tab1.fld = tab2.fld
      

  2.   

    好绕口 
    到底是修改tb2还是tb1啊
      

  3.   

    update tb1 set tb1.fld1=tb2.fld1
    from tb1,tb2
    where tab1.fld = tab2.fld
      

  4.   

    --猜的
    update tab1 set 
        fld1=tb2.fld1
    from tab2
    where tab1.fld = tab2.fld
      

  5.   

    差个a
    update tab1 set 
        fld1=tab2.fld1
    from tab2
    where tab1.fld = tab2.fld
      

  6.   

    不行啊
    update 单因子污染评价
     set  背景值=无机背景值.背景值 from 单因子污染评价, 无机背景值
    where 单因子评价.背景值 = 无机背景值.背景值
      

  7.   


     update tab1
     set tab1.fld1=tab2.fld1
     from tab2 
     where tab1.fld=tab2,fld
     
      

  8.   

    语法错误,操作符丢失,位置在from处
      

  9.   

    你这个条件和SET结果一样,当然没作用了.
      

  10.   

    update a 
    set  a.背景值1=b.背景值1 --确认一下这里要什么
    from 单因子污染评价 a, 无机背景值 b
    where a.背景值 = b.背景值
      

  11.   

    update 单因子污染评价
    set 单因子污染评价.背景值 = 无机背景值.背景值
    where 单因子污染评价.指标=  无机背景值.指标
    我要设置单因子污染评价与无机背景值中指标相同的记录中的背景值为无机背景值中的背景值
      

  12.   

    update tb1 set 
        fld1=tb2.fld1
    from tb2
    where tab1.fld = tab2.fld