Home >Database >Mysql Tutorial >How to use PERIOD_DIFF function in MySQL
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!