Skip to content

Instantly share code, notes, and snippets.

@kokosing
Created March 29, 2016 07:31
Show Gist options
  • Save kokosing/306d43e8dd1801994abe to your computer and use it in GitHub Desktop.
Save kokosing/306d43e8dd1801994abe to your computer and use it in GitHub Desktop.
*** q16.sql 2016-03-25 14:10:21.906553746 +0100
--- q16_modified.sql 2016-03-25 14:10:21.906553746 +0100
***************
*** 3,13 ****
 sum(cs_net_profit) AS "total net profit"
 FROM "${database}"."${schema}".catalog_sales cs1,
 "${database}"."${schema}".date_dim,
 "${database}"."${schema}".customer_address,
 "${database}"."${schema}".call_center
! WHERE d_date BETWEEN '2001-2-01' AND (cast('2001-2-01' AS date) + 60 days)
 AND cs1.cs_ship_date_sk = d_date_sk
 AND cs1.cs_ship_addr_sk = ca_address_sk
 AND ca_state = 'TX'
 AND cs1.cs_call_center_sk = cc_call_center_sk
 AND cc_county IN ('Fairfield County',
--- 3,13 ----
 sum(cs_net_profit) AS "total net profit"
 FROM "${database}"."${schema}".catalog_sales cs1,
 "${database}"."${schema}".date_dim,
 "${database}"."${schema}".customer_address,
 "${database}"."${schema}".call_center
! WHERE d_date BETWEEN '2001-2-01' AND (cast('2001-2-01' AS date) + INTERVAL '60' DAY)
 AND cs1.cs_ship_date_sk = d_date_sk
 AND cs1.cs_ship_addr_sk = ca_address_sk
 AND ca_state = 'TX'
 AND cs1.cs_call_center_sk = cc_call_center_sk
 AND cc_county IN ('Fairfield County',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment