case when contact_number1 ='' or contact_number2 is null then contact_number1
when contact_number1 ='' or contact_number1 is null then contact_number2
when contact_number1 is not null and contact_number2 is not null then concat(contact_number1,',',contact_number2)
end
如果第一種情況是真的,那麼它執行第一種情況下則進入下一個case語句或沒有?postgresql中'case when'的執行過程是什麼?
您還應該在該節末尾包含註釋:「 *如第4.2.14描述的,存在其中表達式的子表達式是在不同時間評估各種情況,以使得「CASE評估僅在必要的子表達式」的原則是不鐵定。例如,一個恆定的1/0子表達式將通常導致在規劃的時候一個部門被零故障,即使它永遠不會在運行時*輸入一個CASE手臂內」 –
啊,錯過了一部分,但它是有道理的 - 規劃仍檢查的條件以及能夠出錯,執行短路 - 感謝您的注意並補充說明! – romeara