Hi! I'm not sure how to phrase this question... anyway, here it is:
I'm trying to show users in DB radius who have exceeded 3221000000 bytes (3GB) within the current month. As of writing I can only display total usage by user with this:
"SELECT username,sum(acctoutputoctets) AS total_usage FROM radacct WHERE EXTRACT(YEAR_MONTH FROM acctstarttime) >= EXTRACT(YEAR_MONTH FROM CURRENT_DATE)and EXTRACT(YEAR_MONTH FROM acctstarttime) < EXTRACT(YEAR_MONTH FROM CURRENT_DATE + INTERVAL 1 MONTH) GROUP BY username ORDER BY total_usage DESC;"
I wanted to add something like a "WHERE total_usage > 3221000000" line but I don't know where to insert it. Any help would be greatly appreciated.
Jopoy
Nov 21
Claudio Nanni Re: Nested WHERE
Nov 21, 2013; 22:40
Claudio Nanni
Re: Nested WHERE
Nov 21
Jopoy Solano Re: Nested WHERE
Nov 21, 2013; 12:33
Jopoy Solano
Re: Nested WHERE
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!