I have a table with rows like this:
Name | date_from | date_to | age
------+------------+------------+-----
Alice | 01.12.2004 | 03.04.2008 | 35
Bob | 04.02.2013 | 04.11.2014 | 43
I would like to make a table that splits each row into one-year intervals by the
date_from and date_to columns, keeping the Name, and updating the age, like this:
Name | date_from | date_to | age
------+------------+------------+-----
Alice | 01.12.2004 | 01.12.2005 | 35
Alice | 01.12.2005 | 01.12.2006 | 36
Alice | 01.12.2006 | 01.12.2007 | 37
Alice | 01.12.2007 | 01.12.2008 | 38
Alice | 01.12.2008 | 03.04.2008 | 39
Bob | 04.02.2013 | 04.02.2014 | 43
Bob | 04.02.2014 | 04.11.2014 | 44
Is this possible to do in SQL?