Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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