如何將以下代碼更改爲返回布爾0或1值的if語句?我希望得到的最終結果是列出2的利率的一列,如果條件爲真,則結果列的值爲0或1。更改SQL服務器中的if語句的時間
(Case when new_interestratevariability = 2
and (new_interestrateindex = 1 or new_interestrateindex = 2 or new_interestrateindex = 3 or new_interestrateindex = 4 or new_interestrateindex = 6)
and new_crms_dt = @Curr_Date
then 0 else 1 end) as CIEDIT_VAL_96,
目前,我得到的東西象下面這樣:
那究竟是什麼問題呢? – Mureinik
你不知道。 IF語句用於控制處理流程。案例表達式用於確定單個列中要返回的值。 –
我的結果列顯示的是不等於2的VariableA值,只想顯示等於2的VariableA值。如果這很有意義 –