2
當n.ownerid爲null,它永遠不會執行此部分:在選擇案例爲NULL檢查
...........,case n.ownerid
when NULL then
(
select systemuserid
from crm_systemuserbase
where firstname = 'CRM' and lastname='Admin'
)...........
這裏的多個周邊代碼:
,case n.ownerid
when NULL then
(
select systemuserid
from crm_systemuserbase
where firstname = 'CRM' and lastname='Admin'
)
when '6e99ff04-f498-e311-93f3-005056a37b31' then
(
select systemuserid
from crm_systemuserbase
where firstname = 'CRM' and lastname='Admin'
)
end as OwnerID
在SELECT CASE怎麼做一個檢查字段問題的值是否爲空?
可能是值得指出的是,這意味着你已經從轉一個簡單的CASE到搜索到的CASE表達式 –