Home >Database >Mysql Tutorial >How to use PERIOD_DIFF function in MySQL

How to use PERIOD_DIFF function in MySQL

PHPz
PHPzforward
2023-05-28 08:28:051322browse

PERIOD_DIFF(monthStart, monthEnd)

SELECT PERIOD_DIFF(1601,1603) 
SELECT PERIOD_DIFF(191602,191607) 
SELECT PERIOD_DIFF(1916-02,1916-07) 
SELECT PERIOD_DIFF(1602,9002)
-> -2
-> -5
-> 5
-> 312

This function returns the number of months between monthStart - monthEnd

The above is the detailed content of How to use PERIOD_DIFF 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