Skip to content

Instantly share code, notes, and snippets.

@Veenap
Last active May 22, 2020 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Veenap/18d14ac3cffbc1913a16f8eded5f781b to your computer and use it in GitHub Desktop.
Save Veenap/18d14ac3cffbc1913a16f8eded5f781b to your computer and use it in GitHub Desktop.
CREATE TABLE NUM_OF_SPINS AS
SELECT anonymous_id
SUM(RUDDER.spin.no_of_spins) as no_of_spins
FROM
SIGNUP_DATE_TABLE,
FIRST_REV_DATE_TABLE,
RUDDER.spin table
WHERE
SIGNUP_DATE_TABLE.anonymous_id = RUDDER.spin_table.anonymous_id
AND SIGNUP_DATE_TABLE.anonymous_id = RUDDER.spin_table.anonymous_id
AND FIRST_REV_DATE.first_rev_date >= RUDDER.spin_table.sent_at
GROUP BY anonymous_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment