Article:
  Emulating Analytic (AKA Ranking) Functions with MySQL
Subject:   Flow sum()? have you any ideas?
Date:   2007-04-02 03:54:44
From:   LionSoftware

The idea to repeat analytic SUM() OVER (PARTITION) is GREAT! But I have no ideas how to repeat SUM() OVER (ORDER BY) on MySQL. Have you any ideas?


Because I trying to repeat this:



Table transactions:
id amount
1 100
2 200
3 -50
4 -10


select id, amount, sum(amount) over (order by id) flowsum from mytable;
id amount flowsum
1 100 100
2 200 300
3 -50 250
4 -10 240

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Stephane Faroult photo Flow sum()? have you any ideas?
    2007-04-02 04:17:01  Stephane Faroult | O'Reilly Author [View]

    There is a part 2 coming :-). It should give you some ideas.