代替 SELECT inv.*, prof.*
显然最终结果是Duplicate column names in the result are not supported. ...
use SELECT inv, prof
如下所示
#standardSQL
WITH inv AS (
SELECT'001' AS company,'abc' AS vendor,800.00 AS transaction,'inv' AS type UNION ALL
SELECT'002' AS company,'efg' AS vendor,23.4 AS transaction,'inv' AS type
), prof AS (
SELECT'001' AS company,'abc' AS vendor,800.00 AS transaction,'prof' AS type UNION ALL
SELECT'002' AS company,'efg' AS vendor,23.4 AS transaction,'prof' AS type
)
SELECT inv, prof
FROM inv FULL JOIN prof
USING (company, vendor, transaction)
结果 :
Row inv.company inv.vendor inv.transaction inv.type prof.company prof.vendor prof.transaction prof.type
1 001 abc 800.0 inv 001 abc 800.0 prof
2 002 efg 23.4 inv 002 efg 23.4 prof
正如您所看到的,结果行现在有两个结构/记录 - 每个结构/记录都包含各自表中的相应条目
出于所有实际原因,我认为这是您最好的选择