Last active
April 21, 2016 07:22
-
-
Save YumaInaura/b2dc08bdd934b7ded6ea to your computer and use it in GitHub Desktop.
BigQuery で WHEN CASE 文が書けない時の対処法 ref: http://qiita.com/Yinaura/items/5cfab23d32a57c259a5c
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 fruit | |
WHEN 'Apple' THEN 'is apple' | |
WHEN 'Orange' THEN 'is orange' | |
ELSE 'none' | |
END AS fruit_kind; |
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
Query Failed | |
Error: searched case expression not supported at: |
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 fruit = 'Apple' THEN 'is apple' | |
WHEN fruit = 'Orange' THEN 'is orange' | |
ELSE 'none' |
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
Row fruit_kind | |
1 is apple |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment