Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
For my Asp .net project i'm using sql server 2008 database...for my project i need to get a particular output from my database.. My condition is..

Suppose there are 4 tables (Table1,Table2.Table3,Table4) in my DB.. each table contain 3 to 4 similar columns...(For eg:-column name A,B,C,D).. My condition is i want to get Column D value(data type int) from all tables in such a way tat if Table1 column D value is one i need to check Table2 D value or i dnt need to check next table values and i want to get tat Table1 column d value to my project.. ( we can use A, B,C as where condition cluse for our query)
Posted
Comments
Kuthuparakkal 6-Jul-13 2:09am    
Post sample table entries in all tables and required output in tabular format

1 solution

This might handy

select table1.D
from table1 table1
LEFT OUTER JOIN TABLE2 table2 on table1.D = table2.D
left outer join table3 table3 on table1.D = table3.D
left outer join table4 table4 on table1.D = table4.D

Thanks.
 
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