Created
March 29, 2016 09:28
-
-
Save kokosing/15d9b246f24c16dc6a80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** q54.sql 2016-03-29 11:24:05.000000000 +0200 | |
--- q54_modified.sql 2016-03-29 11:24:28.000000000 +0200 | |
*************** | |
*** 42,52 **** | |
FROM "${database}"."${schema}".date_dim | |
WHERE d_year = 1999 | |
AND d_moy = 2) | |
GROUP BY c_customer_sk), | |
segments AS | |
! (SELECT cast((revenue/50) AS int) AS segment | |
FROM my_revenue) | |
SELECT segment, | |
count(*) AS num_customers, | |
segment*50 AS segment_base | |
FROM segments | |
--- 42,52 ---- | |
FROM "${database}"."${schema}".date_dim | |
WHERE d_year = 1999 | |
AND d_moy = 2) | |
GROUP BY c_customer_sk), | |
segments AS | |
! (SELECT cast((revenue/50) AS bigint) AS segment | |
FROM my_revenue) | |
SELECT segment, | |
count(*) AS num_customers, | |
segment*50 AS segment_base | |
FROM segments |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment