Skip to content

Instantly share code, notes, and snippets.

@avivl
Last active December 25, 2017 13:10
Show Gist options
  • Select an option

  • Save avivl/e9ecfdb9342a23af9a6515b40d581e4e to your computer and use it in GitHub Desktop.

Select an option

Save avivl/e9ecfdb9342a23af9a6515b40d581e4e to your computer and use it in GitHub Desktop.
SELECT quality ,ratio * 100 AS percent,total FROM (
SELECT quality , count(*) AS total, RATIO_TO_REPORT(total) OVER() AS ratio
FROM [telegrass_reviews.reviews]
GROUP by quality
)
SELECT price ,ratio * 100 AS percent,total FROM (
SELECT price , count(*) AS total, RATIO_TO_REPORT(total) OVER() AS ratio
FROM [telegrass_reviews.reviews]
GROUP by price
)
SELECT quality ,ratio * 100 AS percent,total FROM (
SELECT quality , count(*) AS total, RATIO_TO_REPORT(total) OVER() AS ratio
FROM [telegrass_reviews.reviews]
GROUP by quality
)
SELECT communication ,ratio * 100 AS percent,total FROM (
SELECT communication , count(*) AS total, RATIO_TO_REPORT(total) OVER() AS ratio
FROM [telegrass_reviews.reviews]
GROUP by communication
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment