Comments - QUARTER

1 week, 2 days ago Ian Gilfillan

You can do this with the ADDDATE function to offset by (in your case) three months. For example:

SELECT QUARTER(ADDDATE('2008-01-01', INTERVAL -3 MONTH));
+---------------------------------------------------+
| QUARTER(ADDDATE('2008-01-01', INTERVAL -3 MONTH)) |
+---------------------------------------------------+
|                                                 4 |
+---------------------------------------------------+
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.