How will you calculate the number of days between two dates in MySQL?

We can use DATEDIFF function for this purpose.

The query to get the number of days between two dates in MySQL is as follows:

SELECT DATEDIFF(‘2016-12-31’, ‘2015-01-01’);

Read the full book at www.amazon.com
Posted in MySQL, MySQL Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*