Last active
June 16, 2016 04:33
-
-
Save doryokujin/1704405158d9581ceb0ee1d8c6acc068 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
SELECT | |
td_client_id, | |
cv_td_title, | |
ROW_NUMBER() OVER( PARTITION BY td_client_id ORDER BY time) AS cv_id, | |
time | |
FROM | |
( | |
SELECT time, td_title, td_client_id, cv_td_title | |
FROM | |
( | |
SELECT time, td_title, td_client_id | |
FROM treasuredata_homepage | |
), | |
( | |
SELECT td_title AS cv_td_title | |
FROM master_conversion | |
) | |
WHERE td_title = cv_td_title | |
ORDER BY td_client_id, time | |
) T | |
ORDER BY td_client_id, time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment