Suppose I have some customer IDs and dates of transactions.
ID DATE
1 OCT 1
1 OCT 2
1 OCT 3
1 OCT 31
What I would like is one column showing their previous transaction date, and another showing their next transaction date (shown below).
ID DATE1 DATE2
1 OCT 1 OCT 2
1 OCT2 OCT3
1 OCT 3 OCT 31
Here,ID
is an INTEGER and DATE
is a DATE.
How can I achieve this?