mysql date diff in years code example
Example 1: mysql get date diff in months
SELECT TIMESTAMPDIFF(MONTH, '2012-05-05', '2012-06-15')
Example 2: mysql datediff days
#Get date diff in days
select DATEDIFF('2020-04-13', '2020-04-20');#returns -7
select DATEDIFF('2020-04-20', '2020-04-13');#returns 7