Last active
March 21, 2016 12:13
-
-
Save chribsen/7a85132e2db168fa087f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This SELECT statement counts how many days a pair of users have had at least 1 co-occurence and then bins them by day. | |
-- Used for visualization. | |
select s, sum(t.cou) from generate_series(0,10) as s left join | |
(select user_a, user_b, count(*) as cou from derived_friend_list_days where nr_of_occurences > 0 group by user_a, user_b) as t | |
on t.cou = s | |
group by s; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment