Created
August 16, 2017 09:49
-
-
Save tarnagas/f08765b122e8eab46b0c966647b64895 to your computer and use it in GitHub Desktop.
sample count grouped sql
This file contains 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
SELECT *, ( | |
case when sku = 'W556B' then 1 else 0 end + | |
case when product_type = 'Tapis' then 1 else 0 end | |
) as cnt from etl_raw_import_art | |
WHERE (sku = 'W556B' or product_type = 'Tapis') | |
order by | |
case when sku = 'W556B' then 1 else 0 end + | |
case when product_type = 'Tapis' then 1 else 0 end | |
DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment