Created
April 28, 2018 22:23
-
-
Save MostlyFocusedMike/02785150d306a024d09d4d76a116b0cd 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
SELECT SUM(cats.net_worth) | |
FROM owners | |
INNER JOIN cats_owners | |
ON owners.id = cats_owners.owner_id | |
JOIN cats ON cats_owners.cat_id = cats.id | |
WHERE cats_owners.owner_id = 2; | |
# which will return the following | |
SUM(cats.net_worth) | |
------------------- | |
1181600 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment