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, 4233🔥, 0💬
Popular Posts:
What Privilege Is Needed for a User to Delete Rows from Tables in Another Schema in Oracle? For a us...
What Are the Underflow and Overflow Behaviors on FLOAT Literals in SQL Server Transact-SQL? If you e...
How To View Data Files in the Current Database in Oracle? If you want to get a list of all tablespac...
What Are the Differences between BINARY and VARBINARY in MySQL? Both BINARY and VARBINARY are both b...
What is sqlservr.exe - Process - SQL Server (SQLEX?PRESS) in SQL Server? Process sqlservr.exe is the...