It is necessary to calculate the cumulative sum in a table with a reordered row order (sorted by several fields). It turns out that you cannot use a query of the form:
Select sum(p.val) as sm from test p, test v where p.id<=v.id , since I cannot set the condition "where p.id <= v.id". How to be?