Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I have 4 tables let it be a,b,c,d .I want to innerjoin those 4 tables to get result.Table a's Primary key will be the foregin key of b,c,d .I write a common query to innerjoin those 4 tables.but in my case there may or may not be corresponding data in b,c or d.At that time my query doesnt fetch values .Data returns only when there is a's primary key in the tables b,c and d.How to fetch data even if no datas in any of the table b,c,d.

Thanks in Advance
Amrutha.
Posted

1 solution

Simple. Use a left outer join[^] on table a. This will allow you to get all rows from a irrespective of whether there is a corresponding join in b or not.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900