簡體   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