-
-
13007610673 数据达人Lv4
发表于2018-12-17 12:05
悬赏10
已解决



19个回答
-
13007610673 数据达人Lv4
缱绻 发表于 2018-12-17 14:21
呃呃。。厉害厉害
22.gif
还有一个问题 case when 这个是不是只能 case when ‘’ then 然后就只能else了 不能有多个 when
13007610673 发表于 2018-12-17 14:33
还有一个问题 case when 这个是不是只能 case when ‘’ then 然后就只能else了 不能有多个 when ...
可以多个case when啊
case when ..then...
case when...then...
-
13007610673 数据达人Lv4
缱绻 发表于 2018-12-17 14:51
可以多个case when啊
case when ..then...
case when...then...
难道不是 case when .. then... when...then..else 这个样子么,,,,,,,,
本帖最后由 缱绻 于 2018-12-17 17:20 编辑
13007610673 发表于 2018-12-17 15:08
难道不是 case when .. then... when...then..else 这个样子么,,,,,,,,
参考用法:
case when c2<0.8*e2 then '#3366FF' when c2<e2 and c2>=0.8*e2 then '#00CCFF' when c2>e2 and c2<=1.2*e2 then '#FFFF00' when c2>1.2*e2 and c2<1.5*e2 then '#FF9900' else '#FF0000' end
-
13007610673 数据达人Lv4
缱绻 发表于 2018-12-17 15:38
不是啊 case when里没有else啊,参考用法:
case when c2e2 and c21.2*e2 and c2
过滤条件里面 只能case when '' then '' else '' end 有多个when 就会报NULL 你可以试试看
13007610673 发表于 2018-12-17 15:57
过滤条件里面 只能case when '' then '' else '' end 有多个when 就会报NULL 你可以试试看 ...
case when这个函数仅为内存计算函数,不能用于数据库计算,函数参数中不能有 主题表字段
您这边case when具体是怎么写的呢,就是报表模板中那样么,里面嵌套了if吗?
我这边用case when @aa=1 then "第一" when @aa=2 then "第二" when @aa=3 then "第三" else "无名次" end
测试没有问题呢
-
13007610673 数据达人Lv4
缱绻 发表于 2018-12-17 16:09
case when这个函数仅为内存计算函数,不能用于数据库计算,函数参数中不能有 主题表字段
您这边case when ...
虽然不太懂 但是感觉是我嵌套if的问题吧, ,,把case when 改成IF就好了 只不过条件更长了...
13007610673 发表于 2018-12-17 16:22
虽然不太懂 但是感觉是我嵌套if的问题吧, ,,把case when 改成IF就好了 只不过条件更长了... ...
嗯 我也觉得是嵌套的if的问题