In MySQL, using a query, is there a way to get total time in hours when the time is stored in minutes?
العربية
български
català
中文
čeština
dansk
Nederlands
eesti
suomi
français
Deutsch
Ελληνικά
עברית
हिंदी
magyar
Bahasa Indonesia
italiano
日本語
한국어
latviešu
lietuvių
norsk
polski
Português
română
русский
slovenčina
slovenski
español
svenska
ไทย
Türkçe
українська
Tiếng Việt
In the database, we have a numeric field that represents the total time in minutes for a doctor to evaluate a patient record. And, we have a report that groups by the doctor name and shows the total number of records in one column, the total number of minutes the doctor took to evaluate all of their records in a given time frame in the next column and the total average number of minutes it took for the doctor to evaluate their records during that time frame.
But, we have one customer who wants to see these numbers in hours, not minutes. Is there a way for me to do the division in the query or am I going to have to get the results in minutes and then divide by 60 for each doctor?
Answer |
Something like:
SELECT doctor_id, SUM(minutes_spent) / 60 AS hours_spent
FROM that_table
GROUP BY doctor_id
Ideally I would do the math in my PHP script so that I won't have to mess with the queries every now and then. Customers have a mind of their own you know.