What query should I execute in MySQL database to get a result containing partial sums of source table?
For example when I have table:
Id|Val 1 | 1 2
SELECT l.Id, SUM(r.Val) AS Val FROM your_table AS l INNER JOIN your_table AS r ON l.Val >= r.Val GROUP BY l.Id ORDER By l.Id