Reputation: 340
I have a case that I want find the duration for each "state_id", by subtracting its change_time from the time just below it.
So I want to generate a new column that duplicates the column "change_time" and shifting all values one row up, so the change_time #2(in red) would come next to change_time #3(in red).
Is there a way to shift that column one row up?
Upvotes: 1
Views: 4721
Reputation: 340
After a lot of thinking and researching. I have solved it with the following steps:
Upvotes: 1