I tried to execute following SQL statements in db2v7.2 fp5 on win2k. At the end I get db2 crash. Is there some bug or am I doing something wrong?
CREATE TABLE TAB1 (DATA INTEGER);
INSERT INTO TAB1 VALUES (1),(2),(3),(4),(5);
SELECT DATA, SUM(DATA) OVER (ORDER BY DATA ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS RESULT FROM TAB1;
-- above commands work fine
SELECT DATA, VAR(DATA) OVER (ORDER BY DATA ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS RESULT FROM TAB1;
-- above command crashes the DB2 with error message: "SQL1224N A database agent could not be started to service a request, or was terminated as a result of a database system shutdown or a force command. SQLSTATE=55032"
I would like to write the variance between 1 preceding row and current row. I need this SQL to calculate some more sophisticated formula....