我没环境,哎有个表  test1   有个字段  sal 值为1000update test1 set sal=sal+1000,con=sal*0.1sal=?
con=?

解决方案 »

  1.   

    update test1 set sal=sal+1000,con=sal*0.1 sal=2000
    con=100
      

  2.   

    等号右边的sal相当于select出来的,
    至于sal=2000要等update执行完才生效。
      

  3.   

    在执行此语句时sal=1000
    con=sal*0.1 要按sal=1000去计算
      

  4.   


    都是基于原来sal的计算,所以现在sal=1000+1000, con=1000*0.1
      

  5.   

    sal=1000+1000, con=1000*0.1