mysql minutes to hours and minutes

前端 未结 5 1235
梦谈多话
梦谈多话 2021-01-12 13:50

I have a table that return minutes from a task and I\'d like to convert into hours and minutes.

my select is:

select
m.mat_nome as \'Matéria\',
round         


        
5条回答
  •  说谎
    说谎 (楼主)
    2021-01-12 14:04

    CONCAT(FLOOR(minutes/60),':',LPAD(MOD(minutes,60),2,'0'))
    

    a variation on Damir Kasipovic's code: this converts 62 minutes to '1:02'

提交回复
热议问题