QueryStash

QueryStash

Example SQL

A collection of example SQL snippets that can be found on Query Stash.

QUALIFY by ROW_NUMBER for cleaner queries

Using QUALIFY you can greatly simplify your query when dealing with RANK and ROW_NUMBER, and avoid having multiple sub queries.

QUALIFY by ROW_NUMBER for cleaner queries

Spike Detection for Website Visits

To demonstrate one approach to spike detection, we are exploring website visitor data from the BigQuery Public Google Analytics sample data.

Spike Detection for Website Visits

Merge Statements BigQuery

The combination of insert and update in a merge statement simplifies data processing where we don't know if a record already exists.

Merge Statements BigQuery

Create a Persistent Function on BigQuery

Persistent user-defined functions allow users to create custom functions that can be used across multiple queries and shared amongst users.

Create a Persistent Function on BigQuery

BigQuery Create ML Regression Model

Creating ML models has become even easier with BigQuery ML, create a new model in a few lines of SQL.

BigQuery Create ML Regression Model

BigQuery Create Array of Structs

Working with flattened data might not always be the optimal way to work with data in BigQuery, use arrays to group data together into a single field.

BigQuery Create Array of Structs
QueryStash

QueryStash

Made with ❤️ by @Yekalb

© 2023 Query Stash. All rights reserved

TwitterFacebookEmail

Resources

BlogPricingYour First QuerySearch Your Stash

Stay up to date

Terms of ServicePrivacy Policy