v.23.12New Feature

ORDER BY Clause Enhanced to Support ALL Option in ClickHouse

The ORDER BY clause now supports specifying ALL, meaning that ClickHouse sorts by all columns in the SELECT clause. Example: SELECT col1, col2 FROM tab WHERE [...] ORDER BY ALL. #57875 (zhongyuankai).
The ORDER BY clause now supports the ALL keyword, allowing sorting by all columns in the SELECT clause.

Why it matters

This feature simplifies queries where users want to sort results by every selected column without explicitly listing them, reducing query complexity and potential errors.

How to use it

In your query, use ORDER BY ALL to sort the output by all columns specified in the SELECT statement. For example:

SELECT col1, col2 FROM tab WHERE ... ORDER BY ALL