Is there a difference between:
SELECT DATE_ADD('2005-01-01', INTERVAL 3 MONTH);
and
SELECT '2005-01-01' + INTERVAL 3 MONTH;
The DATE_ADD() function adds a time/date interval to a date and then returns the date.
DATE_ADD() function in MySQL is used to add a specified time or date interval to a specified date and then return the date. Specified date to be modified. Here the value is the date or time interval to add.
There is no DATEPART function in MySQL. Use MONTH(date_column) or EXTRACT(MONTH FROM date_column) instead.
No, they're the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With