Skip to content

Instantly share code, notes, and snippets.

@MostlyFocusedMike
Created April 29, 2018 00:36
Show Gist options
  • Save MostlyFocusedMike/94c66e1eebc64ac924a02d4669c102d8 to your computer and use it in GitHub Desktop.
Save MostlyFocusedMike/94c66e1eebc64ac924a02d4669c102d8 to your computer and use it in GitHub Desktop.
SELECT *
FROM owners
INNER JOIN cats_owners
ON owners.id = cats_owners.owner_id;
# which would return:
id name cat_id owner_id
---------- ---------- ---------- ----------
2 Sophie 3 2
3 Penny 3 3
2 Sophie 1 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment