Created
March 27, 2024 16:07
-
-
Save charles-tan/5bfb7ae6c23459ced7c7e5ab53404b57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE MATERIALIZED VIEW player_wins AS | |
SELECT | |
player_id, | |
COUNT(*) AS games_played, | |
COUNT(CASE WHEN win = true THEN 1 END) AS games_won | |
FROM game_results | |
GROUP BY player_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment