sql - checking for NULL in a select CASE -


when n.ownerid null, never execute part:

...........,case n.ownerid     when null      (     select systemuserid     crm_systemuserbase      firstname = 'crm' , lastname='admin'  )........... 

here's more surrounding code:

,case n.ownerid     when null      (     select systemuserid     crm_systemuserbase      firstname = 'crm' , lastname='admin'     )     when '6e99ff04-f498-e311-93f3-005056a37b31'     (     select systemuserid     crm_systemuserbase      firstname = 'crm' , lastname='admin'     )     end ownerid 

in select case how 1 check whether value of field question null?

use is operator when comparing null

case when n.ownerid null ...      when n.ownerid = '6e99ff04-f498-e311-93f3-005056a37b31' ... end ownerid 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -