如何将以下代码更改为返回布尔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值。如果这很有意义 –