繁体   English   中英

根据 bigquery 中的列值删除行

[英]remove rows based on column value in bigquery

我有一个包含以下数据的表,我想删除国家/地区值为 ['US','EU','pl','nl','es'] 的行

#standardSQL
with table as (
  select 'DE' country, 520 number union all
  select 'NL' country, 520 number union all
  select 'US' country, 530 number union all
  select 'AT' country, 560 number union all
  select 'NL' country, 720 number union all
  select 'CH' country, 5280 number union all
  select 'FR' country, 5250 number union all
  select 'BE' country, 5280 number union all
  select 'IT' country, 4890 number union all
  select 'EU' country, 5005 number union all
  select 'pl' country, 5007 number union all
  select 'nl' country, 5005 number union all
  select 'es' country, 5070 number union all
  select 'ROE' country, 5700 number
)
select * from table
where country not in ['US','EU','pl','nl','es']

我知道 where 语句不能像那样工作,但这是我想要实现的目标,在这里可以提供一些帮助。 先感谢您!

改用下面

select * from table
where not lower(country) in ('us','eu','pl','nl','es')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM