Querying multiple tables in Big Query

后端 未结 5 524
小蘑菇
小蘑菇 2021-01-04 02:10

As it is not possible to update data within a table in BigQuery, and supports only append mechanism, I have decided to create new tables on monthly basis. So suppose for yea

5条回答
  •  滥情空心
    2021-01-04 02:50

    2017 update:

    With BigQuery #standardSQL - you can either use standard UNION ALL to go through multiple tables, or you can use a * to match all tables that share the same prefix. When using the * matcher, you will also have access to the meta-column _TABLE_SUFFIX - to know which table the rows came from.

    SELECT * FROM Roster
    UNION ALL
    SELECT * FROM TeamMascot
    

提交回复
热议问题