Home  >  Article  >  Database  >  How to use PERIOD_ADD function in MySQL

How to use PERIOD_ADD function in MySQL

WBOY
WBOYforward
2023-05-28 18:19:121373browse

PERIOD_ADD(month, add)

SELECT PERIOD_ADD(1601,2) 
SELECT PERIOD_ADD(191602,3) 
SELECT PERIOD_ADD(191602,-3)
-> 201603
-> 191605
-> 191511

This function returns the operation result of increasing or decreasing month. The format of month is yyMM or yyyyMM, and the results returned are in yyyyMM format. , add can pass negative values

The above is the detailed content of How to use PERIOD_ADD function in MySQL. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete