Syntax
PERIOD_DIFF(p1, p2)
Purpose
You can call this function to return 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 (0.01 sec)