Interviewer And Interviewee Guide

MySQL Programming Interview Question:

How To Calculate the Difference between Two Dates?

Submitted by: Administrator
If you have two dates, and you want to know how many days between them, you can use the DATEDIFF(date1, date2) function as shown below:

SELECT DATEDIFF(DATE('1997-02-28'), DATE('1997-03-01'))
FROM DUAL;
-1

Submitted by: Administrator

Read Online MySQL Programming Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.