根据 bigquery 中的列值删除行
remove rows based on column value in bigquery
我有一个包含以下数据的 table,我想删除国家/地区值为 ['US'、'EU'、'pl'、[=18 的行=],'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')
我有一个包含以下数据的 table,我想删除国家/地区值为 ['US'、'EU'、'pl'、[=18 的行=],'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')