I have a select statement that returns date ranges (From and To columns) and I want to generate a list of all dates that are common within all the ranges.
For example:
FROM TO
01-12-2016 11-12-2016
05-12-2016 17-12-2016
07-12-2016 20-12-2016
Now I want to get all the dates that have occurred in all the ranges above. In this case the following dates should be retrieved.
07-12-2016
08-12-2016
09-12-2016
10-12-2016
11-12-2016
because these dates are common in all the returned results. Is this possible with SQL (or PL/SQL)?