Gill Bates Gill Bates - 1 year ago 46
SQL Question

How to extract hour for MySQL FROM_UNIXTIME() results?

I have a column with time of measurments in timestamps in INT, and I need group data by interval of a hour. I already discovered MySQL function FROM_UNIXTIME(), but is there internal instrument in MySQL to extract hour from results of this function?


I think you mean FROM_UNIXTIME

    DATE_FORMAT(FROM_UNIXTIME(time_column), '%Y %m %d %H'))