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
posted @ 2017-03-23 17:20  美好的明天  阅读(30717)  评论(0编辑  收藏  举报