v.23.12New Feature
Introduce PASTE JOIN for Table Row Number Joining
IntroducePASTE JOIN, which allows users to join tables withoutONclause simply by row numbers. Example:SELECT * FROM (SELECT number AS a FROM numbers(2)) AS t1 PASTE JOIN (SELECT number AS a FROM numbers(2) ORDER BY a DESC) AS t2. #57995 (Yarik Briukhovetskyi).
Why it matters
This feature solves the problem of performing joins purely based on the order of rows, eliminating the need for specifying join conditions. It simplifies and optimizes use cases where users want to combine tables side-by-side according to their row positions, improving query expressiveness and usability.How to use it
Users can apply thePASTE JOIN by writing a query using the PASTE JOIN syntax between two table expressions. For example:SELECT * FROM (SELECT number AS a FROM numbers(2)) AS t1 PASTE JOIN (SELECT number AS a FROM numbers(2) ORDER BY a DESC) AS t2