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

  1. mysql> select years_diff('2020-12-25','2019-10-25');
  2. +----------------------------------------------------------+
  3. | years_diff('2020-12-25 00:00:00', '2019-10-25 00:00:00') |
  4. +----------------------------------------------------------+
  5. | 1 |
  6. +----------------------------------------------------------+

keywords

  1. years_diff