【发布时间】:2022-07-05 22:16:58
【问题描述】:
对于 FR、ES 等国家/地区,我需要对 product_name 列应用小写,但对于其他国家/地区,CA、IL、DE 应该没有任何更改。我正在尝试使用此查询,但有些东西不起作用:
SELECT
id
,brand
,cern
,cern_3
,backpack
,qutoation
,product_name
,CASE WHEN country_code in ('FR', 'ES') then lower(product_name) end
,category
,country_code
,timestamp
FROM table.name
【问题讨论】:
-
你错过了 ELSE 部分:
CASE WHEN country_code in ('FR', 'ES') then lower(product_name) ELSE product_name end -
这条评论不应该作为答案吗?
标签: sql google-bigquery