Skip to content

Instantly share code, notes, and snippets.

@Jammink2
Created September 16, 2016 00:23
Show Gist options
  • Select an option

  • Save Jammink2/3b7c3e30f95ad2045046410e218b6619 to your computer and use it in GitHub Desktop.

Select an option

Save Jammink2/3b7c3e30f95ad2045046410e218b6619 to your computer and use it in GitHub Desktop.
SELECT SUM(c) AS total_subscribers, COUNT(email) AS distinct_subscribers FROM (SELECT email, COUNT(1) as c FROM email) tbl -- Get two columns, one total, another # of distinct email addresses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment