Question:
I need a summary-select which summaries cumulative values. This one works in Microsoft Access:
SELECT
s.nl_item_id, s.nl_value,
(
SELECT sum(sub.nl_value) FROM TABLE1 sub
WHERE sub.nl_item_id<=s.nl_item_id
) AS kumul
FROM TABLE1 AS s;
How can I make it work using a BDE-DB2 alias?
Answer:
As far as I know, you can't do this in a single step on most server databases, especially traditional systems like DB2 and Oracle. MS SQL Server's TransactSQL (I think Access uses a variant of that SQL) allows you to shortcut a lot of stuff