栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Google BigQuery的意外行为WHERe NOT list CONTAINS字符串

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Google BigQuery的意外行为WHERe NOT list CONTAINS字符串

这是一个示例查询:

select * from(select 'G01N 33/55' as ipc, 'G01N 34' as not_ipc),(select 'G01N 33/55' as ipc, 'G01N 33' as not_ipc),(select 'G01N 33/55' as ipc, string(null) as not_ipc)where not ipc contains not_ipc or not_ipc is null

这将返回:

+-----+------------+---------+---+| Row |    ipc     | not_ipc |   |+-----+------------+---------+---+|   1 | G01N 33/55 | G01N 34 |   ||   2 | G01N 33/55 | null    |   |+-----+------------+---------+---+

这是另一个:

select * from(select 'G01N 33/55' as ipc, 'G01N 33' as not_ipc, 'C08K 3/08' as exclude, 'C08K 3/08,C08K 77/02' as other_classes),(select 'G01N 33/55' as ipc, 'G01N 34' as not_ipc, string(null) as exclude, 'C08K 3/08,C08K 77/02' as other_classes),(select 'G01N 33/55' as ipc, 'G01N 33' as not_ipc, string(null) as exclude, string(null) as other_classes),(select 'G01N 33/55' as ipc, 'G01N 36' as not_ipc, string(null) as exclude, string(null) as other_classes),(select 'G01N 33/55' as ipc, string(null) as not_ipc, 'C08K 3/08' as exclude, string(null) as other_classes)where (not ipc contains not_ipc or not_ipc is null) and (not other_classes contains exclude or exclude is null or other_classes is null)

返回:

+-----+------------+---------+-----------+----------------------+---+| Row |    ipc     | not_ipc |  exclude  |    other_classes     |   |+-----+------------+---------+-----------+----------------------+---+|   1 | G01N 33/55 | G01N 34 | null      | C08K 3/08,C08K 77/02 |   ||   2 | G01N 33/55 | G01N 36 | null      | null      |   ||   3 | G01N 33/55 | null    | C08K 3/08 | null      |   |+-----+------------+---------+-----------+----------------------+---+


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/431533.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号