Collections:
Calculating the Difference between Two Time Values in MySQL
How To Calculate the Difference between Two Time Values in MySQL?
✍: FYIcenter.com
If you have two time values, and you want to know the time difference between them, you can use the TIMEDIFF(time1, time2) function as shown below:
SELECT TIMEDIFF(TIME('19:26:50'), TIME('09:26:50'))
FROM DUAL;
10:00:00
SELECT TIMEDIFF('1997-03-01 19:26:50.000123',
'1997-02-28 09:26:50.000000') FROM DUAL;
34:00:00.000123
⇒ Presenting a Past Time in Hours, Minutes and Seconds in MySQL
⇐ Calculating the Difference between Two Dates in MySQL
2017-12-26, 3754🔥, 0💬
Popular Posts:
How AdventureWorksLT tables are related in SQL Server? There are 12 user tables defined in Adventure...
How to check if two JSON values have overlaps using the JSON_OVERLAPS() function? JSON_OVERLAPS(json...
How To Provide Default Values to Function Parameters in SQL Server Transact-SQL? If you add a parame...
How To Verify a User name with SQLCMD Tool in SQL Server? The quickest way to verify a user name in ...
What Is a Parameter File in Oracle? A parameter file is a file that contains a list of initializatio...