Created
October 26, 2012 17:12
-
-
Save robertjmoore/3960013 to your computer and use it in GitHub Desktop.
Sample Query for Raw Cohort Analysis Data
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 orders.customerid, | |
orders.transactiondate, | |
orders.transactionamount, | |
cohorts.cohortdate | |
FROM orders | |
JOIN (SELECT customerid, | |
Min(transactiondate) AS cohortDate | |
FROM orders | |
GROUP BY customerid) AS cohorts | |
ON orders.customerid = cohorts.customerid; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment