DoNe does data analysis

More serious discussions, information about official DDNet servers, important announcements.
Nirvana
User
Posts: 7
Joined: Mon Jul 06, 2020 8:57 am

Re: DoNe does data analysis

Post by Nirvana »

timakro wrote:
Tue Jul 07, 2020 6:47 pm
Can't find it on my disk so it's probably lost forever :/
Ah sad news, so maybe you know how can get the mostly "last week/month points" with mysql? I asked for this in viewtopic.php?p=68411&sid=0c169f82cb9cf ... f5b#p68411 but its with python script.

User avatar
deen
Retired Administrator
Posts: 3321
Joined: Mon May 05, 2014 2:30 pm
Player profile: deen

Re: DoNe does data analysis

Post by deen »

I have given it a quick try, here you go:

Code: Select all

select sum(Points) from (select Points from record_race inner join record_maps on record_race.Map = record_maps.Map where Name = "murpi" group by record_race.Map having min(record_race.Timestamp) >= NOW() - INTERVAL 1 WEEK) as m;

select sum(Points) from (select Points from record_race inner join record_maps on record_race.Map = record_maps.Map where Name = "murpi" group by record_race.Map having min(record_race.Timestamp) >= NOW() - INTERVAL 1 MONTH) as m;

Nirvana
User
Posts: 7
Joined: Mon Jul 06, 2020 8:57 am

Re: DoNe does data analysis

Post by Nirvana »

deen wrote:
Tue Jul 07, 2020 10:45 pm
I have given it a quick try, here you go:

Code: Select all

select sum(Points) from (select Points from record_race inner join record_maps on record_race.Map = record_maps.Map where Name = "murpi" group by record_race.Map having min(record_race.Timestamp) >= NOW() - INTERVAL 1 WEEK) as m;

select sum(Points) from (select Points from record_race inner join record_maps on record_race.Map = record_maps.Map where Name = "murpi" group by record_race.Map having min(record_race.Timestamp) >= NOW() - INTERVAL 1 MONTH) as m;
wow cool, is there possible to get top10 last week points with name and points ?

User avatar
deen
Retired Administrator
Posts: 3321
Joined: Mon May 05, 2014 2:30 pm
Player profile: deen

Re: DoNe does data analysis

Post by deen »

Untested, but it probably takes forever:

Code: Select all

select Name, sum(Points) from (select record_race.Name, Points from record_race inner join record_maps on record_race.Map = record_maps.Map group by record_race.Map, record_race.Name having min(record_race.Timestamp) >= NOW() - INTERVAL 1 WEEK) as m group by Name order by sum(Points) desc limit 10;

Nirvana
User
Posts: 7
Joined: Mon Jul 06, 2020 8:57 am

Re: DoNe does data analysis

Post by Nirvana »

deen wrote:
Wed Jul 08, 2020 7:56 am
Untested, but it probably takes forever:

Code: Select all

select Name, sum(Points) from (select record_race.Name, Points from record_race inner join record_maps on record_race.Map = record_maps.Map group by record_race.Map, record_race.Name having min(record_race.Timestamp) >= NOW() - INTERVAL 1 WEEK) as m group by Name order by sum(Points) desc limit 10;
Thanks, worked fine.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests