mysql minutes to hours and minutes

前端 未结 5 1273
梦谈多话
梦谈多话 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:01

    Why not simply do something like this?

    select convert(date_add('2000-01-01', interval 146 minute), time);
    

    This returns 02:26:00

    Or the following if you want to specify return format

    select date_format(date_add('2000-01-01', interval 146 minute), '%h:%i');
    

提交回复
热议问题