QUARTERS_SUB
Descriptionβ
Syntaxβ
DATE/DATETIME QUARTERS_SUB(DATE/DATETIME date, INT years)
Subtract a specified number of quarters for a given date
The parameter date
can be of type DATETIME
or DATE
, and the return type is the same as the type of the parameter date
.
Exampleβ
mysql> select quarters_sub("2020-01-31 02:02:02", 1);
+---------------------------------------------------------------+
| quarters_sub(cast('2020-01-31 02:02:02' as DATETIMEV2(0)), 1) |
+---------------------------------------------------------------+
| 2019-10-31 02:02:02 |
+---------------------------------------------------------------+
1 row in set (0.10 sec)
keywordsβ
QUARTERS, SUB, QUARTERS_SUB