I have the following table of projects with their activity periods (periods are defined with FROM and TO dates):
ID | ProjID | ActiveFrom | ActiveTo
===+========+============+============
1 | 20 | 2018-01-01 | 2018-01-04
2 | 20 | 2018-02-05 | 2018-02-07
3 | 20 | 2018-02-20 | 2018-02-22
4 | 30 | 2018-01-15 | 2018-02-15
There is arbitrary number of activity periods for a project.
I need a query which will return all activity dates for a given project. For example for ProjID=20 the result should be:
2018-01-01
2018-01-02
2018-01-03
2018-01-04
2018-02-05
2018-02-06
2018-02-07
2018-02-20
2018-02-21
2018-02-22