Description\n-----------\n\nMONTHS_BETWEEN returns the number of months between dates two dates. If the first date given is later than the second date, the result is positive; otherwise, the result is negative. If both dates are the same days of the month, or both are last days of months, the result is always an integer. Otherwise, the fractional portion of the result based on a 31-day month is calculated, and considered the difference in time components between the dates.\n\nThe following example calculates the months between two dates:\n\n``sql\nSELECT MONTHS_BETWEEN\n       (TO_DATE('02-02-1995','MM-DD-YYYY'),\n        TO_DATE('01-01-1995','MM-DD-YYYY') \n       );\n`\n\nThe result is 1.03225806`.\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/months_between