v.22.9New Feature
Add INTERSECT DISTINCT and EXCEPT DISTINCT Support
Add support forINTERSECT DISTINCTandEXCEPT DISTINCT. #40792 (Duc Canh Le).
Why it matters
This feature enables users to perform more precise set operations that eliminate duplicate rows from the results ofINTERSECT and EXCEPT. It improves query correctness and aligns ClickHouse with standard SQL behavior for these operations, allowing more accurate data comparison and filtering.How to use it
Users can use the new set operators by includingINTERSECT DISTINCT or EXCEPT DISTINCT in their SQL queries similarly to other set operations. For example:SELECT FROM table1
INTERSECT DISTINCT
SELECT FROM table2This will return distinct rows present in both
table1 and table2.