Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SELECT td_client_id, ROW_NUMBER() OVER (PARTITION BY td_client_id ORDER BY time) AS node_id, td_title, time
FROM
(
SELECT
raw_data.td_client_id AS td_client_id, td_title, raw_data.time AS time
FROM
(
SELECT td_client_id, td_title, time
FROM treasuredata_homepage
) raw_data
LEFT OUTER JOIN
(
SELECT td_client_id, cv_id, time
FROM itmd_conversion_history
) cv_history
ON
( raw_data.td_client_id=cv_history.td_client_id )
-- conversion history に存在しなかったユーザーを絞り込み --
WHERE cv_history.td_client_id IS NULL
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
You can’t perform that action at this time.