【问题标题】:Reading derived column expression读取派生列表达式
【发布时间】:2019-07-01 16:39:33
【问题描述】:

我需要帮助阅读这个包含多个布尔表达式的令人困惑的派生列表达式。

我尝试了多种阅读方式,但不确定哪一种是正确的。

ISNULL(ContractNumber) ? (ISNULL(PaidLossAmount) 
&& ISNULL(CaseReserveAmount)) ? NULL(DT_CY) : 
(ISNULL(PaidLossAmount) ? 0 : PaidLossAmount) + (ISNULL(CaseReserveAmount) 
? 0 : CaseReserveAmount) : PaidLossAmount

有人可以建议如何阅读这个表达式吗?感谢您的建议!

【问题讨论】:

    标签: sql-server ssis etl derived-column


    【解决方案1】:

    这是 [逻辑测试] 格式的嵌套 if then else 吗? [如果为真,请执行此操作]:[如果为假,请执行此操作]

    这是格式化的版本。

    ISNULL(ContractNumber) 
         ?(ISNULL(PaidLossAmount) && ISNULL(CaseReserveAmount)) 
                  ?NULL(DT_CY) 
                  : (ISNULL(PaidLossAmount) 
                                ? 0 
                                : PaidLossAmount) 
                     + (ISNULL(CaseReserveAmount) 
                                ? 0 
                                : CaseReserveAmount) 
         : PaidLossAmount
    

    这是一个决策树:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-17
      • 1970-01-01
      • 2015-03-01
      • 1970-01-01
      相关资源
      最近更新 更多