I have a table that has a column date. Dates range from Jan 01 2002 to today. However there are several dates missing in the year.
How can I find out which distinct dates are not in the table?
For example, from this table (The first and third columns are irrelevant):
+------------+----------+-----------+
| subject | date | value |
+------------+----------+-----------+
| Biology |2016-01-02| 90000.00 |
| Comp. Sci. |2016-01-03| 100000.00 |
| Elec. Eng. |2016-01-04| 85000.00 |
| Finance |2016-01-06| 120000.00 |
| History |2016-01-07| 50000.00 |
| Music |2016-01-10| 80000.00 |
| Physics |2016-01-11| 70000.00 |
+------------+----------+-----------+
I would like the query to return the following:
2016-01-01
2016-01-05
2016-01-08
2016-01-09
2016-01-12
....
2016-12-21
Furthermore, can I find which of these missing dates are weekdays?
So, I can get
2016-01-01
2016-01-05
2016-01-08
2016-01-12
....
2016-01-09 is missing since it is a Saturday.
Thanks.