weeks_sub
weeks_subβ
descriptionβ
Syntaxβ
DATETIME WEEKS_SUB(DATETIME date, INT weeks)
Subtracts a specified number of weeks from a datetime or date
The parameter date can be DATETIME or DATE, and the return type is consistent with that of the parameter date.
exampleβ
mysql> select weeks_sub("2020-02-02 02:02:02", 1);
+-------------------------------------+
| weeks_sub('2020-02-02 02:02:02', 1) |
+-------------------------------------+
| 2020-01-26 02:02:02 |
+-------------------------------------+
keywordsβ
WEEKS_SUB