PostgreSQL: increment column value in select statement based on previous values
I am using Postgresql 13 and I have a table that looks something like this: event_id timestamp 1 2022-11-28 00:00:00 1 2022-11-28 00:00:10 2 2022-11-28 00:00:20 2 2022-11-28 00:00:30 2 2022-11-28 00:00:40 3 2022-11-28 00:00:50 3 2022-11-28 00:01:10 1 2022-11-28…