Created
May 16, 2012 17:26
-
-
Save mikegrassotti/2712394 to your computer and use it in GitHub Desktop.
cohort activity
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
select DATE_FORMAT(u.created_at, '%Y-%m'), DATE_FORMAT(p.published_at, '%Y-%m'), count(*) FROM pfeed_items p, users u where u.id = p.originator_id and p.type IN ('Pfeeds::UserJoinedGroup', 'Pfeeds::UserLeftGroup', 'Pfeeds::UserInvitedUser', 'Pfeeds::UserSharedActivity', 'Pfeeds::UserMessagedGroup', 'Pfeeds::UserPostedItem', 'Pfeeds::UserAttachedTag', 'Pfeeds::UserCreatedBlogPost', 'Pfeeds::UserLikedItem', 'Pfeeds::UserFollowedItem') AND u.created_at > '2012-01-01' AND p.published_at > '2012-01-01' GROUP BY DATE_FORMAT(u.created_at, '%Y-%m'), DATE_FORMAT(p.published_at, '%Y-%m') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment