Mysql: How do i convert from minutes to TIME format?

Today, I needed to convert a minutes string to TIME format.

basically, I had to combine FLOOR, MOD, CONCAT and TIME functions.

Like this:

SELECT TIME(CONCAT(floor(45 / 60),':', MOD(45, 60)))

Anúncios