Performing query using Left Outer Join in SQL Server
Hi. How to perform a query through the use of Left Outer Join in SQL Server.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pravin MoreRank #1,419 · 1.2K reputationPosted Dec 18, 2011, 7:31 PM EST
here is way..........
select t1.*,t2.* from table1 t1 (nolock)
left outer join table2 t2 (nolock) on t1.ID=t2.ID
so above query will return All matching records + nonmatching record of table1.
suppose table1 is like ...
ID empName Designation
1 Pravin S/W Dev.
2 Monika S/W Dev.
3 XYZ S/W Dev.
and table2 is like.....
ID Salary
1 20000
2 25000
so in this case result of above query will be
ID empName Designation ID Salary
1 Pravin S/W Dev. 1 20000
2 Monika S/W Dev. 2 25000
3 XYZ S/W Dev. null null
Thanks,
Pravin.