mysql - Select data where datetime is less than 30 days -


i have freeradius-mysql query select data acctstarttime more 30 days:

below query:

select sum(acctinputoctets -            greatest((30 - unix_timestamp(acctstarttime)), 0)) +        sum(acctoutputoctets -            greatest((30 - unix_timestamp(acctstarttime)), 0))   radacct  username = 'user2'    , unix_timestamp(acctstarttime) + acctsessiontime > 30 

i have query of same nature selects data acctstarttime less 30 days , im having hard time.

can help?

try this:

select  acctstarttime     radacct      acctstarttime < adddate(acctstarttime, interval 30 day)   

for more info , functions: date , time functions


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -