Skip to content

Instantly share code, notes, and snippets.

@develop7
Created January 8, 2011 20:52
Show Gist options
  • Save develop7/771144 to your computer and use it in GitHub Desktop.
Save develop7/771144 to your computer and use it in GitHub Desktop.
SELECT t1.id, count(t2.id) from table1 t1 inner join table2 t2 on t2.category=t1.id group by t1.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment