I have a table like so
+---------+
| weekday |
+---------+
| 2 |
| 5 |
| 3 |
+---------+
Now I want to have a resultset in which I see the dates of this and the upcoming week like so:
+------------+---------+
| date | weekday |
+------------+---------+
| 2019-12-18 | 2 |
| 2019-12-21 | 5 |
| 2019-12-19 | 3 |
| 2019-12-25 | 2 |
| 2019-12-28 | 5 |
| 2019-12-26 | 3 |
+------------+---------+
So far I have this query
SELECT
CURDATE() + INTERVAL w.weekday - WEEKDAY(CURDATE()) DAY AS thisWeek,
CURDATE() + INTERVAL w.weekday + 7 - WEEKDAY(CURDATE()) DAY AS nextWeek,
dw.weekday
FROM
weekdays AS w
Which gives me this result
+------------+------------+---------+
| thisWeek | nextWeek | weekday |
+------------+------------+---------+
| 2019-12-18 | 2019-12-25 | 2 |
| 2019-12-21 | 2019-12-28 | 5 |
| 2019-12-19 | 2019-12-26 | 3 |
+------------+------------+---------+
How would I have to need to proceed to get the former resultset?