oracle判断字段是否为0,如果为0,字段取空decode函数

2014-11-24 15:25:13 · 作者: · 浏览: 0

oracle判断字段是否为0,如果为0,字段取空decode函数
declare www.2cto.com
val number;
res number;
begin
val := -10;
select decode(sign(val),0,'',val) into res from dual;
dbms_output.put_line(res);
end;