简单的判断可以用decode函数
例如:如果字段a是null,值为0;如果是''值也为0,否则就是a的值。
select decode(a,null,0,'',0,a) from table
当需要有多个条件并列的时候,用case when then
select
case
when 条件1 then action1
when 条件2 then action2
when 条件3 then action3
when 条件N then actionN
else action
end aa
from table