case when then 中的条件里面加上 and or 的处理方式

错误的方式:

case when t.batchid  <>' ' and  is not null then 1 else 0 end

正确1:

case when (t.batchid  <>' ' and t.batchid is not null) then 1 else 0 end

正确2,去掉括号:

case when t.batchid  <>' ' and t.batchid is not null then 1 else 0 end
原文地址:https://www.cnblogs.com/alsf/p/6606227.html