select case when (c1 is null) and (c2 is null) then 0
else 1 end as val from t1;
这种方法应该不是最效率的...
这里是不是要用位运算?
...全文
4986打赏收藏
【求助】ORACLE 判断两列NULL情况最效率的方法
表有巨量数据 create table t1(c1 varchar2(100), c2 varchar2(100)); 需求: 输出一个结果列 若c1和c2中有一个不为空,输出1 否则输出0 select case when (c1 is null) and (c2 is null) then 0 else 1 end as val from t1; 这种方法应该不是最效率的... 这里是不是要用位运算?