Syntax
PERIOD_DIFF(p1, p2)
Purpose
PERIOD_DIFF() returns the interval between two dates, in months. The date can contain only the year and month in the format of YYYYMM or YYMM.
Examples
obclient> SELECT PERIOD_DIFF(200802, 200703);
+----------------------------+
| PERIOD_DIFF(200802,200703) |
+----------------------------+
| 11 |
+----------------------------+
1 row in set