From: Ant Zucaro Date: Mon, 31 Dec 2012 03:41:11 +0000 (-0500) Subject: Add player retention query X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonstatdb.git;a=commitdiff_plain;h=202c53a8a920d8c972cfa439160d77822609186f;hp=fdc05eb7f97220dbcaf7febb2184e684d9ff4d63 Add player retention query --- diff --git a/queries/player_retention_3months.sql b/queries/player_retention_3months.sql new file mode 100644 index 0000000..e19ff14 --- /dev/null +++ b/queries/player_retention_3months.sql @@ -0,0 +1,23 @@ +-- how many distinct player_ids play in multiple months +select count(*) +from players +where +player_id in ( + select distinct player_id + from player_game_stats + where create_dt between (current_timestamp at time zone 'UTC' - interval '1 month') + and (current_timestamp at time zone 'UTC') +) +and player_id in ( + select distinct player_id + from player_game_stats + where create_dt between (current_timestamp at time zone 'UTC' - interval '2 month') + and (current_timestamp at time zone 'UTC' - interval '1 month') +) +and player_id in ( + select distinct player_id + from player_game_stats + where create_dt between (current_timestamp at time zone 'UTC' - interval '3 month') + and (current_timestamp at time zone 'UTC' - interval '2 month') +) +; \ No newline at end of file