Skip to content

Instantly share code, notes, and snippets.

@toyeiei
Last active November 9, 2018 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toyeiei/04db492c283a9879ab1a995a057d28b6 to your computer and use it in GitHub Desktop.
Save toyeiei/04db492c283a9879ab1a995a057d28b6 to your computer and use it in GitHub Desktop.
SQL for Beginner - GROUP BY P1
-- count number of customers by country
SELECT
country,
COUNT(*) AS n
FROM customers
GROUP BY country;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment