I want to create a column where the first element is equal to the second element of another column for the same ID.The last date will be a default value.
For example, I have this table:
ID | start_date |
---|---|
123 | 03/04/2022 |
123 | 06/04/2022 |
123 | 08/05/2022 |
123 | 10/05/2022 |
123 | 15/05/2022 |
123 | 20/05/2022 |
I want to get this output:
ID | start_date | end_date. |
---|---|---|
123 | 03/04/2022 | 06/04/2022 |
123 | 06/04/2022 | 08/05/2022 |
123 | 08/05/2022 | 10/05/2022 |
123 | 10/05/2022 | 15/05/2022 |
123 | 15/05/2022 | 20/05/2022 |
123 | 20/05/2022 | 01/01/1999 |
I don't have any idea how to do it.