BigQuery launches DISTINCT pipe operator for selecting unique rows in queries

July 22, 2025 at 4:16:28 AM

TL;DR BigQuery now supports the DISTINCT pipe operator in pipe syntax queries, which returns distinct rows from an input table while preserving table aliases. It works like SELECT DISTINCT or UNION DISTINCT but can be used anywhere in the query. It computes distinct rows based on all visible columns, ignoring pseudo-columns, and does not expand value table fields. This feature is generally available.

BigQuery launches DISTINCT pipe operator for selecting unique rows in queries

The BigQuery update introduces the DISTINCT pipe operator, now generally available (GA), which allows selecting distinct rows from a table within pipe syntax queries. This operator returns distinct rows based on all visible columns, ignoring pseudo-columns, and preserves table aliases from the input.

Key Features of DISTINCT Pipe Operator

  • Can be applied anywhere in the pipe syntax, unlike traditional SELECT DISTINCT or UNION DISTINCT which are limited to specific clauses.
  • Computes distinct rows based on all visible columns.
  • Ignores pseudo-columns when computing distinct rows and excludes them from the output.
  • Similar to using |> SELECT DISTINCT *, but it does not expand value table fields and keeps table aliases intact.

Example Usage

A query with multiple rows, including duplicates, uses the |> DISTINCT operator to filter unique rows and then applies a WHERE clause to select rows where sales are greater than or equal to 3:

(
  SELECT 'apples' AS item, 2 AS sales
  UNION ALL
  SELECT 'bananas' AS item, 5 AS sales
  UNION ALL
  SELECT 'bananas' AS item, 5 AS sales
  UNION ALL
  SELECT 'carrots' AS item, 8 AS sales
)
|> DISTINCT
|> WHERE sales >= 3;

The result returns distinct rows for "bananas" and "carrots" with sales values 5 and 8 respectively.

Have more questions on this topic? Ask our AI assistant for in-depth insights.

Read more from sources 👇

The Only Digital Marketing Feed You'll Ever Need.

Stay informed your way. Tailored updates when and how you want them. 100% Free.

10,000+ Users

500+ Sources

1000+ Tools

Or

Related Posts

AI marketing workflows made simple

AI marketing workflows made simple

Featured
Markifact
Markifact

Verified Sponsor

Verified Sponsor

Markifact is a Verified Sponsor. Want to get featured here? Contact us.

Verified Sponsor
BigQuery sets default on-demand query limit to 200TB per day from September 2025

BigQuery sets default on-demand query limit to 200TB per day from September 2025

BigQuery Sharing Listings Can Now Be Monetized on Google Cloud Marketplace

BigQuery Sharing Listings Can Now Be Monetized on Google Cloud Marketplace

Google Cloud
Google Cloud

Official Source

Official Source

Google Cloud is a Official Source. The source has been verified by Swipe Insight team.

Official Source
Google Introduces Automated Data Insights Feature for BigQuery with Gemini Integration

Google Introduces Automated Data Insights Feature for BigQuery with Gemini Integration

Google Cloud
Google Cloud

Official Source

Official Source

Google Cloud is a Official Source. The source has been verified by Swipe Insight team.

Official Source
BigQuery adds configuration settings and new data loading features

BigQuery adds configuration settings and new data loading features

Google Cloud
Google Cloud

Official Source

Official Source

Google Cloud is a Official Source. The source has been verified by Swipe Insight team.

Official Source
Google Enhances BigQuery with Continuous Queries and Cross-Regional Federated Queries

Google Enhances BigQuery with Continuous Queries and Cross-Regional Federated Queries

Google Cloud
Google Cloud

Official Source

Official Source

Google Cloud is a Official Source. The source has been verified by Swipe Insight team.

Official Source
BigQuery launches Snowflake transfer scheduling preview and cross-region data transfer GA

BigQuery launches Snowflake transfer scheduling preview and cross-region data transfer GA

Google Cloud
Google Cloud

Official Source

Official Source

Google Cloud is a Official Source. The source has been verified by Swipe Insight team.

Official Source
BigQuery Now Shows Query Text in Execution Graph

BigQuery Now Shows Query Text in Execution Graph

Related Tools

Markifact logo

Markifact

Verified Tool

Verified Tool

Markifact is a Verified Tool. Want to get this badge? Contact us.

Verified Tool

Marketing Workflows Powered by AI

Featured
Marketing Auditor logo

Marketing Auditor

Verified Tool

Verified Tool

Marketing Auditor is a Verified Tool. Want to get this badge? Contact us.

Verified Tool

Automated audits for Google Ads and Analytics.

Get Featured Here

Showcase your tool in this list.

Contact Us
Databricks logo

Databricks

Generative AI-powered data intelligence platform

Data Engineering
GA4 SQL logo

GA4 SQL

Verified Tool

Verified Tool

GA4 SQL is a Verified Tool. Want to get this badge? Contact us.

Verified Tool

Generate GA4 BigQuery queries easily

Data Analysis
TapClicks logo

TapClicks

Automated marketing solutions powered by your data

Data Engineering
Stitch logo

Stitch

Automated cloud data pipelines, no coding needed

Data Engineering
Akkio logo

Akkio

AI-powered analytics for agencies

Data Analysis
NinjaCat logo

NinjaCat

AI-powered marketing data and analytics platform

Reporting
Funnel logo

Funnel

Aggregate and analyze marketing data seamlessly

Reporting
Fivetran logo

Fivetran

Effortlessly centralize and move data from any source

Data Engineering

Get Featured Here

Showcase your tool in this list.

Contact Us