update a
set
as=decode((as-6),1,as,0)

解决方案 »

  1.   

    也可以用update a set as=0 where er<=6
      

  2.   

    sorry,我漏了sign
    update a
    set
    as=decode(sign(as-6),1,as,0)
      

  3.   

    sign(num):
    if num>0 then  
      return 1
    if num<0 then 
      return -1
    if num=0 then 
      return 0
      

  4.   

    update table set as=0 where er<=6;
      

  5.   

    简单的问题不要想的太复杂,呵呵~update tab set as =0 where as<=6
      

  6.   

    create table temp1 as
    select er, decode(sign(as-6),1,as,0) as
      from table1