Skip to content

Commit 676f0b5

Browse files
committed
Section 02 : Basic Agg : part 04 - P8
1 parent ac5ac58 commit 676f0b5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
SELECT
2+
ROUND(
3+
COUNT(A1.player_id)
4+
/ (SELECT COUNT(DISTINCT A3.player_id) FROM Activity A3)
5+
, 2) AS fraction
6+
FROM
7+
Activity A1
8+
WHERE
9+
(A1.player_id, DATE_SUB(A1.event_date, INTERVAL 1 DAY)) IN (
10+
SELECT
11+
A2.player_id,
12+
MIN(A2.event_date)
13+
FROM
14+
Activity A2
15+
GROUP BY
16+
A2.player_id
17+
);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy