How to calculate the difference between two time values?



How to calculate the difference between two time values?..

Answer / Himanshu Vishnoi

In MySQL, you can calculate the difference between two time values using TIMESTAMPDIFF function: SELECT TIMESTAMPDIFF(unit, start_time, end_time); where unit is the type of time interval (YEAR, MONTH, DAY, HOUR, MINUTE, or SECOND).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More MySQL Interview Questions

What language is mysql written in?

1 Answers  


what is the default port for mysql server? : Mysql dba

1 Answers  


List some mysql advantages and disadvantages?

1 Answers  


Where is the mysql data directory?

1 Answers  


What does blob mean in mysql?

1 Answers  


How to display nth highest salary from a table in a mysql query?

1 Answers  


How do we delete a row in a table?

1 Answers  


How do I change global variables in mysql?

1 Answers  


What is pragma serially_reusable and why is it used?

1 Answers  


How to get the number of rows selected or affected by a sql statement?

1 Answers  


what is mysql optimization in brief?

1 Answers  


How can I insert images into a Mysql database?

1 Answers  


Categories