Skip to content

Instantly share code, notes, and snippets.

@carlineng
Created February 23, 2023 04:05
Show Gist options
  • Save carlineng/703a08b36cd77055aa4073d9c01e9786 to your computer and use it in GitHub Desktop.
Save carlineng/703a08b36cd77055aa4073d9c01e9786 to your computer and use it in GitHub Desktop.
TPC-DS Query 33
query: all_sales + {
join_one: manufacturers is from(
item -> {
group_by: i_manufact_id
where: i_category = 'Electronics'
}
) on item.i_manufact_id = manufacturers.i_manufact_id
} -> {
group_by: item.i_manufact_id
aggregate: total_ext_sales_price
where:
date_dim.d_year = 1998
and date_dim.d_moy = 5
and customer_address.ca_gmt_offset = -5
and manufacturers.i_manufact_id != null
order_by: total_ext_sales_price
limit: 100
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment