SQLite Forum

can we use a for/while loop inside sqlite triggers ?
Login
Hi Simon,

I was thinking that this could be implemented, but I don't know how.

I imagine creating a dynamic column containing the sum of the "size_t" starting from the older row (reverse order)

But how to create this dynamic column that aggregates data from other rows? Using a virtual table?

I am really curious about this

-- EDIT --

OK, it appears that using window functions (SUM OVER) could help, as described here:

[https://stackoverflow.com/a/58339386/4626775](https://stackoverflow.com/a/58339386/4626775)