Топ-100
 

PERIOD_DIFF

База данных: MySQL
Текст

Syntax:
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.

URL: https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html

Пример

mysql> SELECT PERIOD_DIFF(200802,200703);
-> 11