I need a MySQL query for the following. I have a table of time duration as such below:
`hsncs_tbl`
+----+-----------------+
| Id | time_duration |
+----+-----------------+
| 1 | 0:12 |
---- -----------------
| 2 | 0:18 |
---- -----------------
Using a MySQL query, I need to be able to calculate these time duration. So from the table above I would get the answer of 0:30.
I tried this code many times, but still not working
SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(time_duration))) FROM hsncs_tbl
Here's the screenshot of my code together with the output.
Related questions:
Sum of time in PHP
How to get the sum of time from database?
How to get the sum of time from database in PHP?
How to display the sum of time from database using php?