如何在 BigQuery 中用简单的单行定义临时常量表(或 Postgres,其语法可能适用于 BigQuery)?
with my_fruits as (
--- ??? define a table
--- consisting of a single column fruit_name
--- with values ('apple', 'pear', 'gooseberry', ... (12 more fruits))
)
select * from my_fruits left join
(select fruit_name, 1 is_present from my_dataset.your_fruits)
using (fruit_name)
最佳答案
您可以使用UNNEST :
select * from unnest(['apple', 'pear', 'gooseberry']) as fruit_name
您还可以加入 UNNEST directly .
关于postgresql - 在 BigQuery(或 Postgres)中定义常量表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65103868/