Q&A for those who study, teach, research and apply economics and econometrics
create table #test ( id int ) create table #test2 ( id int ) insert into #test values(1) insert into #test2 values(1) insert into #test values(2) insert into #test2 values(3) select * from #test left join #test2 on #test.id = #test2.id drop table #test drop table #test2