Home > Database > Mysql Tutorial > body text

How to use PERIOD_DIFF function in MySQL

PHPz
Release: 2023-05-28 08:28:05
forward
1306 people have browsed it

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)
Copy after login
-> -2
-> -5
-> 5
-> 312
Copy after login

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template