I have two columns in a MySQL table:
I want to run a MySQL query that will provide date diffe
TRY with
PERIOD_DIFF(P1,P2)
Returns the number of months between periods P1 and P2. P1 and P2 should be in the format YYMM or YYYYMM. Note that the period arguments P1 and P2 are not date values.
YYMM
YYYYMM
mysql> SELECT PERIOD_DIFF(200802,200703); -> 11