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

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -