*SELECt inv.*, prof.*
显然,最终Duplicate column names in the result are notsupported. ...
*使用
SELECT inv, prof如下所示, 而不是 最终 使用
#standardSQLWITH 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, profFROM inv FULL JOIN profUSING (company, vendor, transaction)
结果 :
Row inv.company inv.vendor inv.transaction inv.type prof.company prof.vendor prof.transaction prof.type 1 001abc 800.0 inv 001 abc800.0 prof 2 002efg 23.4 inv 002 efg23.4 prof
如您所见,结果行现在具有两个结构/记录-每个都包含来自相应表的相应条目
我认为,从所有实际原因出发,这是您最好的选择
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)