これにはtemp_readingというテーブルがあり、次の列があり、消費がプライマリキーです。
id consumption total
1 100
1 200
1 300
1 400
2 50
2 100
3 200
4 250
今、私は合計をとして表示したい
id consumption total
1 100 100
1 200 300
1 300 600
1 300 900
2 50 50
2 100 150
3 200 200
4 250 250
上記のように表示することは可能ですか私は次のクエリを試しました
select id,consumption,sum(consumption) as total
from temp_reading
group by consumption;
これを解決するのを手伝ってください