这是我的代码
SELECT
IF(or_opp.has_something = 1, metric.a, NULL) as a,
IF(or_opp.has_something = 1, metric.b, NULL) as b,
IF(or_opp.has_something = 1, metric.c, NULL) as c,
IF(or_opp.has_something = 1, metric.d, NULL) as d,
有没有办法写这个所以我只需要检查or_opp.has_something
一次吗?
编辑:(出于性能原因)