Loading lesson path
Concept visual
Start at both ends
Add a specified number of months to a period:
SELECT PERIOD_ADD(201703, 5);The PERIOD_ADD() function adds a specified number of months to a period.
The PERIOD_ADD() function will return the result formatted as YYYYMM.PERIOD_ADD( period, number )
Required. A period. Format: YYMM or YYYYMM number Required. The number of months to add to period. Both positive and negative values are allowed
From MySQL 4.0
Add a specified number of months to a period:
SELECT PERIOD_ADD(201703, 15);Add a specified number of months to a period:
SELECT PERIOD_ADD(201703, -2);❮ MySQL Functions