Google bigquery bigquery中是否有与postgres Any()数组等价的内容?
最近从Postgres开始讨论BigQuery——我习惯于在特定情况下相当经常地使用以下模式,但当然不会在CTE集太大的情况下使用Google bigquery bigquery中是否有与postgres Any()数组等价的内容?,google-bigquery,Google Bigquery,最近从Postgres开始讨论BigQuery——我习惯于在特定情况下相当经常地使用以下模式,但当然不会在CTE集太大的情况下使用 with cte1 as ( select id from my_table where feature1 = x, feature2 = y ) select id, detail1, detail2, detail3 from my_table where id = ANY( select id from cte1 ) 使用我的CTE作为收集特定
with cte1 as (
select id from my_table where feature1 = x, feature2 = y
)
select id, detail1, detail2, detail3 from my_table
where id = ANY( select id from cte1 )
使用我的CTE作为收集特定兴趣记录的地方的效果—共同点、不常见点、异常值、重复点等,然后使用id=CTE模式中的任意选择id将其传递给我的主选择
BigQuery中的等价物是什么?等价物是
where id in ( select id from CTE )
因此,您的查询可以如下所示
with cte1 as (
select id from my_table where feature1 = x and feature2 = y
)
select id, detail1, detail2, detail3 from my_table
where id in ( select id from cte1 )
等价物是
where id in ( select id from CTE )
因此,您的查询可以如下所示
with cte1 as (
select id from my_table where feature1 = x and feature2 = y
)
select id, detail1, detail2, detail3 from my_table
where id in ( select id from cte1 )