Skip to content

Instantly share code, notes, and snippets.

@otkrsk
Created March 5, 2013 06:47
Show Gist options
  • Save otkrsk/5088490 to your computer and use it in GitHub Desktop.
Save otkrsk/5088490 to your computer and use it in GitHub Desktop.
Sum a MySQL COUNT query
SELECT SUM(A.COUNT)
FROM
(SELECT COUNT(*) AS count FROM table1
union all
SELECT COUNT(*) AS count FROM table2) A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment