How to use a CTE in a left outer join?
The CTE must come at the beginning of the query.
with cte as ( select column1, column2 from table2)select column1, column2 from table1 LEFT JOIN cteon table1.column1 = cte.column1;
The CTE must come at the beginning of the query.
with cte as ( select column1, column2 from table2)select column1, column2 from table1 LEFT JOIN cteon table1.column1 = cte.column1;