1

我目前为这两个语句保存了两个单独的搜索列,我希望将它们组合起来并仅在一列中列出数据。我尝试过 OR AND,但结果随后出错。

{item.custitem54} 为 null 然后 {quantity} 为 null 结束时的第一个语句情况

当 {item.custitem54} = 'Yes' 和 {shipdate} 在 to_date('05/25/2020', 'MM/DD/YYYY') 和 to_date('12/25/2020', 'MM/ DD/YYYY') 然后 {quantity} else null end

4

1 回答 1

2

一个 case 语句中可以有多个 WHEN。第一个匹配的 WHEN 确定结果,除非它到达 ELSE。

Case when {item.custitem54} = 'Yes' 
          and {shipdate} between date '2020-05-25' and date '2020-12-25' then {quantity} 
     when {item.custitem54} is null then {quantity} 
     else null 
end
于 2019-12-19T21:22:07.570 回答