I have the following temporary table I created from a view in T-SQL:
Id | Expiration Date | Expiration Update Date
--------------------------------------------------------
38 | 2018-01-31 00:00:00.000 | Dec 13 2017 6:28PM
37 | 2017-08-31 00:00:00.000 | Jun 1 2017 6:15PM
37 | 2017-06-15 00:00:00.000 | May 10 2017 8:33PM
38 | 2017-12-31 00:00:00.000 | Nov 21 2017 3:38PM
37 | 2018-03-31 00:00:00.000 | Feb 16 2018 7:10PM
38 | 2018-09-30 00:00:00.000 | Mar 13 2018 2:29PM
37 | 2018-01-31 00:00:00.000 | Dec 13 2017 6:28PM
39 | 2018-10-31 00:00:00.000 | Jan 22 2018 6:38PM
37 | 2017-06-30 00:00:00.000 | May 9 2017 8:30PM
37 | 2017-12-31 00:00:00.000 | Nov 21 2017 3:38PM
39 | 2018-08-31 00:00:00.000 | Jan 2 2018 4:08PM
I want to create query that will display it as
Id | Expiration Date 1| Update Date 1 | Expiration Date 2| Update 2
-----------------------------------------------------------------------------
37 | 2017-06-30 | Nov 21 2017 3:38PM | 2017-12-31 |Nov 21 2017 3:38PM
38 | 2017-12-31 | Nov 21 2017 3:38PM | 2018-01-31 |Dec 13 2017 6:28PM
39 | 2018-08-31 | Jan 2 2018 4:08PM | 2018-10-31 |Jan 22 2018 6:38PM
I cut out the time stamp for the expiration dates to save space. The idea is a new column would be created for every instance of an expiration date of that ID along with a second column for when that expiration date was updated in the system. The catch is each idea does not have an equal number of expiration dates so the IDs with less expiration dates will have NULL values for the extra columns, which I am ok with.