google-big-queryHow do I use the "not in" operator in Google BigQuery?
The "not in" operator is used in Google BigQuery to filter out results that don't match a certain criteria. It works by excluding results that appear in a specified list.
For example, the following code block will return all the books from the bigquery-public-data.hacker_news.stories
table that are not written by authors with the names "Paul Graham", "Robert C. Martin" and "Steve McConnell":
SELECT title
FROM `bigquery-public-data.hacker_news.stories`
WHERE author NOT IN ("Paul Graham", "Robert C. Martin", "Steve McConnell")
The code block consists of the following parts:
SELECT title
: This part specifies the columns from the table that should be returned.FROM
bigquery-public-data.hacker_news.stories`: This part specifies the table to query from.WHERE author NOT IN ("Paul Graham", "Robert C. Martin", "Steve McConnell")
: This part specifies the criteria for the query. It excludes all results that match any of the names in the list.
For more information about the "not in" operator, see the BigQuery documentation.
More of Google Big Query
- ¿Cuáles son las ventajas y desventajas de usar Google BigQuery?
- How can I use Google BigQuery to wait for a query to complete?
- How can I use Google Big Query to analyze Reddit data?
- How can I compare Google BigQuery and AWS Redshift for software development?
- How do I use Google Big Query with Zoom?
- How can I compare Google BigQuery and Snowflake for software development?
- How can I create a Google BigQuery table?
- How can I use Google BigQuery to create a pivot table?
- How can I use Google Big Query to count the number of zeros in a given dataset?
- How do I use the YEAR function in Google BigQuery?
See more codes...