Mysql PERIOD ADD
From w3cyberlearnings
Contents |
MySQL PERIOD_ADD Function
This function returns a new period from newly added period.
Syntax PERIOD_ADD
- Period: A period value (format: YYMM or YYYYMM)
- N: months
PERIOD_ADD(Period, N);
Example 1: YYYYMM
mysql> SELECT PERIOD_ADD(201204,5); +----------------------+ | PERIOD_ADD(201204,5) | +----------------------+ | 201209 | +----------------------+ 1 row in set (0.00 sec)
Example 2: YYMM
mysql> SELECT PERIOD_ADD(1201,5); +----------------------+ | PERIOD_ADD(201201,5) | +----------------------+ | 201206 | +----------------------+ 1 row in set (0.00 sec)