Q&A for professional and enthusiast programmers
with T1(id,colA) as ( select 1, 'X' union all select 1, 'Y' union all select 2, 'Z' ), T2(id,colB) as ( select 1, 'AB' union all select 3, 'CD' ) select * from T1 left join T2 on T1.id = T2.id