我有一個表格,從任務返回分鐘,我想轉換成小時和分鐘。mysql分鐘到幾小時和幾分鐘
我的選擇是:
select
m.mat_nome as 'Matéria',
round(
sum(
case when Hour(TIMEDIFF(est_horario_inicial, est_horario_final))*60 = 0
then Minute(TIMEDIFF(est_horario_inicial, est_horario_final))
else Hour(TIMEDIFF(est_horario_inicial, est_horario_final))*60
end
)/60
,2)
as 'tempo' from estudos_realizados e
left join materias m on e.mat_id = m.mat_id;
所以這回從我的桌子和1.67100分鐘時60分 我希望得到的結果1h40m小時和分鐘。
這可能嗎?我怎樣才能將數字分成60,並將小數修改爲60?
謝謝!