select decode(sign(a-b),1,a,b) from table_name

解决方案 »

  1.   

    select a.a from table_name a,table_name b where a.a>=b.b
    UNION
    select b.b from table_name a,table_name b where a.a<=b.b
      

  2.   

    to:zlqs
    decode(sign(a-b),1,a,b) 这个东东麻烦你解释一下好不好,不然我下一次又要问了!
    多谢,你解释一下我就结帖!
      

  3.   

    DECODE( expr, search, result [, search, result] ... [, default] ) 
    SIGN
       If n<0, the function returns -1; if n=0, the function returns 0; if 
        n>0, the function returns 1.