Skip to content

Instantly share code, notes, and snippets.

@mlukaszewski
Last active August 29, 2015 14:22
Show Gist options
  • Save mlukaszewski/d75aaeb825ed2a673cd9 to your computer and use it in GitHub Desktop.
Save mlukaszewski/d75aaeb825ed2a673cd9 to your computer and use it in GitHub Desktop.
counting with 1:n tables example (for Kukasz)
SELECT *, COUNT(tags_in_usage.id_tags) AS liczba_filmow
FROM tags
JOIN tags_in_usage ON tags_in_usage.id_tags=tags.id_tags
GROUP BY tags_in_usage.id_tags;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment