---
title: "Pipelined SQL in ClickHouse 26.8"
description: "ClickHouse 26.8 introduces pipelined SQL, extending the earlier ability to place FROM before SELECT with a |> operator for sequencing query transformations. Using the UK property prices dataset, the post compares conventional, FROM-first, and pipelined forms for filtering London sales, aggregating median prices by district, ordering results, and limiting output. Each pipeline stage acts as a complete-query checkpoint, while EXPLAIN SYNTAX shows that ClickHouse translates the syntax into nested standard SQL and optimizes the complete query without materializing every intermediate result. The syntax also supports EXTEND, reuse of aggregation aliases in later stages, views, and INSERT ... SELECT statements, though stage order affects which rows feed subsequent aggregations in these examples; the conclusion is that pipelines complement rather than replace conventional SQL."
---

# Pipelined SQL in ClickHouse 26.8

[Clickhouse](https://yomu.fyi/company/clickhouse) · Sep 4, 2026

**Type:** Explainer

## Summary

ClickHouse 26.8 introduces pipelined SQL, extending the earlier ability to place FROM before SELECT with a |> operator for sequencing query transformations. Using the UK property prices dataset, the post compares conventional, FROM-first, and pipelined forms for filtering London sales, aggregating median prices by district, ordering results, and limiting output. Each pipeline stage acts as a complete-query checkpoint, while EXPLAIN SYNTAX shows that ClickHouse translates the syntax into nested standard SQL and optimizes the complete query without materializing every intermediate result. The syntax also supports EXTEND, reuse of aggregation aliases in later stages, views, and INSERT ... SELECT statements, though stage order affects which rows feed subsequent aggregations in these examples; the conclusion is that pipelines complement rather than replace conventional SQL.

## Context

SQL is traditionally written with the returned columns first, even when the underlying work is understood as a sequence of reading data, filtering, aggregating, ordering, and limiting. ClickHouse previously allowed FROM before SELECT, and version 26.8 extends that top-down style with pipelined SQL.

## Approach / What changed

Pipelined SQL uses the |> operator to pass each stage's result into the next transformation. The post demonstrates WHERE, AGGREGATE, ORDER BY, LIMIT, EXTEND, and SELECT stages, shows the generated SQL with EXPLAIN SYNTAX, and applies pipelines in views and INSERT ... SELECT statements.

## Takeaways

- Each |> stage is an explicit checkpoint where the preceding pipeline forms a complete query, making incremental construction and inspection easier.
- EXPLAIN SYNTAX reveals nested SELECT statements generated from a pipeline, but ClickHouse optimizes the complete query rather than materializing every intermediate result.
- Pipeline stage order changes semantics: placing LIMIT before a second aggregation makes that aggregation use only the limited intermediate rows.

**Tags:** [ClickHouse](https://yomu.fyi/topic/clickhouse), [SQL](https://yomu.fyi/topic/sql)

- Source: [Clickhouse](https://clickhouse.com/blog/pipelined-sql-26.8)
- Source URL: https://clickhouse.com/blog/pipelined-sql-26.8
- Ingested by Yomu: 2026-09-04T16:00:46.725Z

[Read original post](https://clickhouse.com/blog/pipelined-sql-26.8)
