Last active
November 18, 2021 06:07
-
-
Save zeke/de280d672ac5ab58a0612d3e9c134909 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# The predictions table is called models_prediction | |
# The users table is called users_user | |
# Select all predictions where the user id is equal to the user with username 'zeke' | |
SELECT * FROM models_prediction WHERE user_id = (SELECT id FROM users_user WHERE username = 'zeke'); | |
# Count all predictions where the user id is equal to the user with username 'zeke' | |
SELECT COUNT(*) FROM models_prediction WHERE user_id = (SELECT id FROM users_user WHERE username = 'zeke'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment