SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
drop function if exists my_sec_to_time; delimiter $$ create function my_sec_to_time(inp_s int) returns varchar(25) deterministic begin declare h int; declare m int; declare s int; set s = inp_s - (h * 3600); set h = floor(inp_s / 3600); set m = floor(s / 60); set s = s - (m * 60); return concat(h, ':', m, ':', s); end $$ delimiter ; select my_sec_to_time(123456);
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear