mysql 8 time difference in days code example
Example 1: 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
Example 2: mysql filter based on datediff
SELECT *
FROM myTable
WHERE birthdate >= 'date1' AND death <= 'date2' AND age > 17 AND age < 55;