Skip to content

Instantly share code, notes, and snippets.

@ian-whitestone
Created March 18, 2023 12:29
Show Gist options
  • Save ian-whitestone/f5f86b1dc6e7857a5eb8a9bc7ed67dab to your computer and use it in GitHub Desktop.
Save ian-whitestone/f5f86b1dc6e7857a5eb8a9bc7ed67dab to your computer and use it in GitHub Desktop.
Example Snowflake CTE query
with sample_data as (
select *
from snowflake_sample_data.tpch_sf1.customer
),
nation_14_customers as (
select *
from sample_data
where c_nationkey = 14
),
nation_9_customers as (
select *
from sample_data
where c_nationkey = 9
)
select *
from nation_14_customers
union all
select *
from nation_9_customers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment