mysql - SQL query to find rows between now and time in long -


i need run sql query find rows of data falls between particular interval of 1 hour, 1 day, 1 month , on. here time of hour or month passing in millis i.e long value of time duration below query

between (now() - interval " + timeduration + ") , now() - used pass time duration in string (1 hour) while using query , worked awesome

is of no me

can between query long time duration can 1 hour, 1 day , 1 week i.e. 3600000,86400000 , on

use timestampadd like;)

between timestampadd(hour, -1, now()) , now() 

and day:

between timestampadd(day, -1, now()) , now() 

Comments

Popular posts from this blog

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

android - Create single AAR file from multiple modules using Gradle -

Android: SharingActionView on swipe from bottom -