需要帮助,以防万一,但这是行不通的:
拥有这个:
SELECT *,
CASE
WHEN scorecard_id = '4.2.2' then (
CASE
WHEN xpav = '110_0_0_0_email_extension' AND xval = 'com' THEN '77.187'
ELSE '49.595'
END ) when
(
CASE
WHEN xpav = '13_0_0_0_age' AND xval BETWEEN '18' AND '23' THEN '1.829'
ELSE '49.595'
END )) endI需要
IF
scorecard_id = '4.2.2'
and xpav = '110_0_0_0_email_extension'
AND xval = 'com'
then '77.187' else '20.058'
if scorecard_id = '4.2.2'
and xpav = '13_0_0_0_age' AND xval BETWEEN '18' AND '23'
THEN '1.829'
if scorecard_id = '4.2.2'
xpav = '13_0_0_0_age' AND xval BETWEEN '24' AND '26'
then '49.061'
else 49.595我有很多标准,但我至少要从一开始就开始,这样我就能理解并继续知道如何去做。
发布于 2022-08-17 08:23:33
对于第二个大小写表达式,您需要有另一个条件。
case
when scorecard_id='4.2.2' and xpav = '110_0_0_0_email_extension' and xval = 'com' then '77.187'
when scorecard_id = '4.2.2' and xpav = '13_0_0_0_age' and xval between 18 and 23 then '1.829'
when scorecard_id = '4.2.2' and xpav = '13_0_0_0_age' and xval between 24 and 26 then '49.061'
when scorecard_id = '4.2.2' and xpav = '13_0_0_0_age' and xval
not between 24 and 26 or xval not between 18 and 23 then '49.061'
else '20.058'
endhttps://stackoverflow.com/questions/73385016
复制相似问题