years_diff
years_diffβ
descriptionβ
Syntaxβ
INT years_diff(DATETIME enddate, DATETIME startdate)
The difference between the start time and the end time is several years
exampleβ
mysql> select years_diff('2020-12-25','2019-10-25');
+----------------------------------------------------------+
| years_diff('2020-12-25 00:00:00', '2019-10-25 00:00:00') |
+----------------------------------------------------------+
| 1 |
+----------------------------------------------------------+
keywordsβ
years_diff