Skip to content

Instantly share code, notes, and snippets.

@dstufft
Created March 20, 2014 19:31
Show Gist options
  • Select an option

  • Save dstufft/9671927 to your computer and use it in GitHub Desktop.

Select an option

Save dstufft/9671927 to your computer and use it in GitHub Desktop.
SELECT EXTRACT(WEEK FROM download_time), python_type, COUNT(*)
FROM (
SELECT python_type, download_time
FROM downloads
WHERE installer_type = 'pip' AND installer_version != ''
) AS d
GROUP BY EXTRACT(WEEK FROM download_time), python_type
ORDER BY EXTRACT(WEEK FROM download_time), python_type, COUNT(*);
date_part | python_type | count
-----------+-------------+---------
1 | cpython | 1692826
1 | pypy | 9063
2 | cpython | 4611979
2 | pypy | 34403
2 | | 16
3 | cpython | 4886633
3 | pypy | 33240
4 | cpython | 4411912
4 | pypy | 29453
5 | cpython | 5508653
5 | pypy | 31135
6 | cpython | 5791703
6 | pypy | 31914
7 | cpython | 5712817
7 | pypy | 32139
8 | cpython | 5910326
8 | pypy | 37793
9 | cpython | 6228472
9 | pypy | 30621
10 | cpython | 6635601
10 | pypy | 41071
11 | cpython | 6420537
11 | pypy | 35227
12 | cpython | 2190123
12 | pypy | 10319
(25 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment