CodePudding user response:
Where datewith recursive t (d, n) as (
The select now (), 1
Union all
The select date_sub (d, 14 day interval), n + 1 from t where n<=10)
Select * from t;
| a n d |
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - | -- - |
The 2020-02-13 17:33:51 | 1 |
The 2020-01-30 17:33:51 | 2 |
The 2020-01-16 17:33:51 | 3 |
The 2020-01-02 17:33:51 | | 4
The 2019-12-19 17:33:51 | | 5
The 2019-12-05 17:33:51 6 | |
The 2019-11-21 17:33:51 7 | |
The 2019-11-07 17:33:51 8 | |
The 2019-10-24 17:33:51 | | 9
The 2019-10-10 17:33:51 | | 10
The 2019-09-26 17:33:51 11 | |