我正在编写一个查询,其中我希望使用嵌套的case语句。我可能会使用IF函数,甚至可以使用coalesce,但我特别想使用用例语句。然而,在下面为其他人编写其他替代方案总是受欢迎的。我的查询是这样的: CASE WHEN priceddate is not null then Case when lunchname = 'Mac' then when createddate
我正在尝试摆脱所有的动态SQL代码。此存储过程似乎需要一些带有WHERE子句的嵌套CASE语句。这和预期的一样工作。然而,我担心的是性能。将嵌套的( GuarantorNumber not in ( select...))语句,如果父CASE语句不为真,是否执行?WHERE 1 = CASE WHEN ( @method='ADDED_
我想使用CASE语句来有条件地检查参数,比如if parameter is an empty string I want to return Nil if not then string 'test',而且我也不想用聚结
select TEST=CASE '' WHEN '' THEN 'Nil' ELSE 'Test' END,current_timestamp from sysibm.sysdummy1令牌=不是有效<e