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