mysql query from hourly to 2 hourly -


how can change query below 2 hours instead of 1

select date_format(x.time,'%y-%m-%d %h:00:00')      , avg(ph) avg_ph   ph x time >= now() - interval 1 day  group      date_format(x.time,'%y-%m-%d %h:00:00'); 

select date_format(from_unixtime(floor(unix_timestamp(x.time)/7200)*7200),'%y-%m-%d %h:00:00') `two_hour`      , avg(ph) avg_ph   ph x time >= now() - interval 1 day  group      `two_hour` 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -