Skip to content

Commit 9f16f44

Browse files
committed
Upload 145
1 parent cce67ea commit 9f16f44

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ The problems and both submitted and site solutions are documented in individual
177177
| 142 | [Product Price at a Given Date](https://leetcode.com/problems/product-price-at-a-given-date/description/) | [Solution](solutions/142_product_price_at_a_given_date.md) | LeetCode | Medium | `UNION ALL`, `LEFT JOIN`, Window Function |
178178
| 143 | [Rank Scores](https://leetcode.com/problems/rank-scores/description/) | [Solution](solutions/143_rank_scores.md) | LeetCode | Medium | |
179179
| 144 | [Customers Who Never Order](https://leetcode.com/problems/customers-who-never-order/description/) | [Solution](solutions/144_customers_who_never_order.md) | LeetCode | Easy | |
180+
| 145 | [Game Play Analysis I](https://leetcode.com/problems/game-play-analysis-i/description/) | [Solution](solutions/145_game_play_analysis_i.md) | LeetCode | Easy | |
180181
<!-- Index End - WARNING: Do not delete or modify this markdown comment. -->
181182

182183
## Author(s)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# SQL Everyday \#145
2+
3+
## Game Play Analysis I
4+
5+
Site: LeetCode\
6+
Difficulty per Site: Easy
7+
8+
## Problem
9+
10+
Write a solution to find the first login date for each player.
11+
12+
Return the result table in *any order*. [[Full Description](https://leetcode.com/problems/game-play-analysis-i/description/)]
13+
14+
## Submitted Solution
15+
16+
```sql
17+
-- Submitted Solution
18+
WITH cte AS (
19+
SELECT
20+
player_id
21+
,event_date
22+
,ROW_NUMBER() OVER (PARTITION BY player_id ORDER BY event_date ASC) AS rownum
23+
FROM Activity
24+
)
25+
SELECT
26+
player_id
27+
,event_date AS first_login
28+
FROM cte
29+
WHERE rownum = 1
30+
;
31+
```
32+
33+
## Site Solution
34+
35+
```sql
36+
-- LeetCode Solution
37+
-- TBD
38+
```
39+
40+
## Notes
41+
42+
TBD
43+
44+
## NB
45+
46+
TBD
47+
48+
Go to [Index](../?tab=readme-ov-file#index)\
49+
Go to [Overview](../?tab=readme-ov-file)

0 commit comments

Comments
 (0)