I've been trying to figure this one out for days, but I can't really manage.
select time, sum(usercount) as count from Wholist group by time order by time;
That's the query I've got. It returns how many users were online at a specific time. My problem is this:
I want to return the last 200 entrys. I've been trying to use limit but to no avail. Alot of people suggest making 2 queries, eg:
totalrows = select count(times) as total from Wholist;
select time, sum(usercount) as count from Wholist group by time order by time limit totalrows-200, -1;
I thought of this too, but I want to do it in 1 query. I was thinking of this:
select time, sum(usercount) as count from Wholist group by time order by time limit count(time)-200, -1;
But that doesn't work. a friend explained to me why, and it makes sense realy 😛
Anyway. PLEASE help.
Yours,
JoerT