I have a dataset like this:
sID Key date
-----------------------
AAA 123 2009-05-27
AAA 457 1985-01-01
BBB 890 1900-01-01
BBB 785 2008-09-05
I want to have a pivoted view of the dates, it should look like this :
sID Key start_date end_date
-----------------------------------
AAA 123 2009-05-27 2050-12-30
AAA 457 1985-01-01 2009-05-26
The end date of the second column should not overlap with the start date of the first column. The end date of the first column is just a random date I chose