I have a table that includes these columns:
track track_id
-----------------
1 1
1 1
0 2
1 2
1 2
0 3
1 3
1 3
0 4
0 5
....
I have the column track and want to calculate track_id, which would be:
Starting by 1, every time track is 0, track_id should be incremented by 1 (0 specifies the beginning of a new track).
I wish I could set a variable and then increment it every time the condition is true, but there does't seem to be a simple way to do that.
I would appreciate a query that can pull this. Thank you.