解决方案 »

  1.   

    update cnycb c
       set c.scph = (select max(scrq) + 1 from cnycb b where b.wjph = '123')
    不就行了么。。要保证scrq能转换为数字,否则回报错
      

  2.   

    说句老实话,语句可能有点问题:update cnycb c
       set c.scph =
           (select a.scph+1
              from cnycb a
             where a.scrq = (select max(scrq) from cnycb b where b.wjph = '123')) 这样是更新cnycb的所有列为一个值,尼克想清楚了
      

  3.   


    update cnycb c
       set c.scph = (select a.scph
                       from cnycb a
                      where a.scrq =(
                            (select max(scrq) from cnycb b where b.wjph = '123')) + 1);