Group by 5 minute interval cakephp -
select timestamp, name, count(b.name) time a, id … group unix_timestamp(timestamp) div 300, name i have above table , want count created_at column group 5 minutes interval of created_at , count create_at column 2016-09-01 16:21:29 2016-09-01 16:26:29
you have use floor() function unique integer every 5 minute
select timestamp, name, count(b.name) time a, id … group floor(unix_timestamp(timestamp)/300) 
Comments
Post a Comment