O
O
Ord EO2020-02-29 18:47:14
MySQL
Ord EO, 2020-02-29 18:47:14

How to calculate date difference in MySQL?

There is a table in which 3 columns are important to me - the name also has two columns with dates, for example:
name _______________start_date________________________end_date
John N. _____________ 2011-06-16______________________2025-06-16
Nick H. _____________ 2001-01-13______________________2003-02-02
... ................................................. ................................................
How to write a query that would bring me all the people who have a difference between the first and second dates of 4 months or less?
Is it possible to do this with MySQL alone?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2020-02-29
@Zarom

You can use TIMESTAMPDIFF

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question