Bigquery wildcard table
时间: 2023-09-19 14:11:42 浏览: 120
BigQuery wildcard tables allow you to query multiple tables that share a common prefix using a single SQL statement. This can be useful when you have a large number of tables with similar names and want to analyze them together.
To use a wildcard table in BigQuery, you need to specify the common prefix followed by an asterisk (*) in the FROM clause of your SQL statement. For example, if you have tables named "my_table_20210101", "my_table_20210102", and "my_table_20210103", you could query them all together using the following SQL statement:
```
SELECT *
FROM `my_dataset.my_table_*`
```
This statement would return all rows from all tables that match the prefix "my_table_", regardless of the date suffix. You can also use other wildcard characters, such as question marks (?), to match specific characters in the table name.
Note that wildcard tables have some limitations, such as not being able to use them in certain types of joins or subqueries. You should also be careful to avoid querying too many tables at once, as this can impact query performance.
阅读全文