
Answer-first summary for fast verification
Answer: Use the __PARTITIONTIME pseudo-column in the WHERE clause
Partitioned tables in BigQuery include a pseudo column named `_PARTITIONTIME` that contains a date-based timestamp for data loaded into the table. To query specific partitions, such as January 1st and 2nd of 2017, you can use a clause like this: `WHERE _PARTITIONTIME BETWEEN TIMESTAMP('2017-01-01') AND TIMESTAMP('2017-01-02')`. This method efficiently limits your query to the specified partitions. For more details, refer to the [BigQuery documentation on partitioned tables](https://cloud.google.com/bigquery/docs/partitioned-tables#the_partitiontime_pseudo_column).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.