SELECT
row_Id ,
MODIFICATION_NUM,
(
SELECT
SUM(t2.MODIFICATION_NUM)
FROM
(
SELECT
row_number() over() AS row_no ,
tm_Task.*
FROM
tm_Task ) t2
WHERE
t2.row_no between 1 and t1.row_no) AS sumq
FROM
(
SELECT
row_number() over() AS row_no ,
tm_Task.*
FROM
tm_Task ) t1
row_Id ,
MODIFICATION_NUM,
(
SELECT
SUM(t2.MODIFICATION_NUM)
FROM
(
SELECT
row_number() over() AS row_no ,
tm_Task.*
FROM
tm_Task ) t2
WHERE
t2.row_no between 1 and t1.row_no) AS sumq
FROM
(
SELECT
row_number() over() AS row_no ,
tm_Task.*
FROM
tm_Task ) t1