nvl没有这种用法的.你应该也是想用nvl2的. SQL> select nvl(null,null,1) from dual;
select nvl(null,null,1) from dual
ORA-00909: invalid number of arguments NVL2(expr1, expr2, expr3) NVL2 lets you determine the value returned by a query based on whether a specified expression is null or not null. If expr1 is not null, then NVL2 returns expr2. If expr1 is null, then NVL2 returns expr3.
from table
where ....;
from table
where ....;
应该更好一点
from table
where ....;
在水一方太狠了。
length(col)-length(replace(col,' ',''))+length(col2)-length(replace(co2l,' ',''))......
SQL> select nvl(null,null,1) from dual;
select nvl(null,null,1) from dual
ORA-00909: invalid number of arguments
NVL2(expr1, expr2, expr3)
NVL2 lets you determine the value returned by a query based on whether a specified expression is null or not null. If expr1 is not null, then NVL2 returns expr2. If expr1 is null, then NVL2 returns expr3.
select nvl2(字段1,0,1)+....+nvl2(字段n,0,1)