Nithya
Nithya

Reputation: 1121

How to calculate time difference between start time and end time?

Here is the query which i have tried.. Don't know why it is not working..

SELECT function_code,start_time,end_time,TIMEDIFF('end_time','start_time') ,total_units FROM function

enter image description here

Upvotes: 0

Views: 885

Answers (1)

Sudhir Sapkal
Sudhir Sapkal

Reputation: 1038

Try this

SELECT function_code,start_time,end_time,TIMEDIFF(end_time,start_time) ,total_units FROM function

This should work as you have used single quote for end_time and start_time, TIMEDIFF function considered it as time not the columns hence your output is not coming what you expected.

Upvotes: 5

Related Questions