我需要计算表中特定组2天之间的百分比差异。
我需要在Error compiling to JavaScript:
main.dart:2:6:
Error: This requires the 'non-nullable' experiment to be enabled.
天与20190731
天之间使用[值]列在字段[FUND]中更改[组]列的百分比。在我的示例中,应为20190628
。
答案 0 :(得分:0)
我希望这对您有用:
select prd, grp, 100.0 * (sum(end_value) - sum(start_value)) / sum(start_value)
from
(
select prd, grp,
(case when date = "20190731" then val else 0 end) as end_value,
(case when date = "20190628" then val else 0 end) as start_value
from table1
) as t
group by prd, grp