最初的BigQuery不支持标准的SQL成语
INSERT foo SELECT a,b,c from bar where d>0;
,你不得不这样做他们的w^AY与--append_table
但据@ WILL的回答,现在的工作。最初BQ
,有
bq query --append_table ...
为BQ查询命令的帮助
$ bq query --help
,并且输出显示在输出的前25%的append_table选项。
Python script for interacting with BigQuery.
USAGE: bq.py [--global_flags] <command> [--command_flags] [args]
query Execute a query.
Examples:
bq query 'select count(*) from publicdata:samples.shakespeare'
Usage:
query <sql_query>
Flags for query:
/home/paul/google-cloud-sdk/platform/bq/bq.py:
--[no]allow_large_results: Enables larger destination table sizes.
--[no]append_table: When a destination table is specified, whether or not to
append.
(default: 'false')
--[no]batch: Whether to run the query in batch mode.
(default: 'false')
--destination_table: Name of destination table for query results.
(default: '')
...
相反追加两个表一起,你可能会用UNION ALL
是串联的SQL的版本更好。
在大的查询中逗号或两个表之间,
操作中SELECT something from tableA, tableB
是UNION ALL
,而不是一个JOIN
,或者至少这是我最后一次看。
嗨@cpburnz,你们是对的,我没有让自己清楚答案。我只是编辑它以清楚我的标准功能的含义。被接受的答案是“这是一个耻辱bigquery不支持解决它的标准方式”,现在不是这样,所以我决定发布如何使用标准来做到这一点。现在让我知道答案是否合适。 –
感谢发布。我会编辑它。 – Paul