v.18.12Improvement

Duplicate Columns in USING Clause for JOIN

Duplicate columns can be used in a USING clause for JOIN. #3006
Duplicate columns can now be used in the USING clause of JOIN operations in ClickHouse.

Why it matters

This feature allows users to join tables on multiple columns having the same name more conveniently by specifying duplicate column names in the USING clause. It simplifies writing join conditions when dealing with tables sharing column names and improves query readability and usability.

How to use it

When writing a JOIN query, include multiple column names with duplicates inside the USING clause as usual. For example:

SELECT * FROM table1
JOIN table2 USING (column1, column2, column1)

This instructs ClickHouse to perform the join using all specified columns, including duplicates.