Skip to content

Instantly share code, notes, and snippets.

@andreleoni
Created January 21, 2019 20:12
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 andreleoni/3708cd58e730d72bc644515d17722de0 to your computer and use it in GitHub Desktop.
Save andreleoni/3708cd58e730d72bc644515d17722de0 to your computer and use it in GitHub Desktop.
total of purchase ratings on the years
SELECT COUNT(DISTINCT (CASE WHEN bundle_id IS NOT NULL THEN bundle_id END )) + COUNT(CASE WHEN bundle_id IS NULL THEN 1 END)
FROM purchase_ratings
WHERE created_at BETWEEN to_date('01/09/2018', 'DD/MM/YYYY') AND to_date('30/09/2018', 'DD/MM/YYYY')
Janeiro
39,688
Fevereiro
33,252
Março
40,374
Abril
44,135
Maio
45,839
Junho
50,552
Julho
43,725
Agosto
45,727
Setembro
39,247
Outubro
37,415
Novembro
31,133
Dezembro
30,762
Total 2018: 495,705
Total 2017: 554,004
Total 2016: 21,666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment