Du kan bruge en midlertidig variabel for at beregne den kumulative sum:
SELECT a.num,
(@s := @s + a.num) AS cumulative
FROM ID a, (SELECT @s := 0) dm
ORDER BY a.num;
Du kan bruge en midlertidig variabel for at beregne den kumulative sum:
SELECT a.num,
(@s := @s + a.num) AS cumulative
FROM ID a, (SELECT @s := 0) dm
ORDER BY a.num;