Skip to content

Instantly share code, notes, and snippets.

@pstorch
Created January 12, 2020 11:32
Show Gist options
  • Save pstorch/8cc48b7fa6ca69a4f4f3e4c20128285e to your computer and use it in GitHub Desktop.
Save pstorch/8cc48b7fa6ca69a4f4f3e4c20128285e to your computer and use it in GitHub Desktop.
RSAPI DB Queries
-- photographers by number of countries
SELECT u.name, count(distinct countrycode) as countries FROM `photos` p join users u on u.id = p.photographerid group by photographerid order by count(distinct countrycode) desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment