Group by 5 minute interval cakephp -


select     timestamp,      name,     count(b.name) time a, id  … group  unix_timestamp(timestamp) div 300, name 

enter image description here

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

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -