Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
in my DB i have 8 type of different tables and each table i want few columns like this way total 8 tables columns in single out put .

so please give me the example query .

sql server 2012, win 10 os .

What I have tried:

i tried join's . but it showing same data in each column (what i have in first record in my table).
Posted
Updated 3-Dec-17 22:40pm
Comments
RDBurmon 1-Dec-17 2:20am    
do they have same columns?
RDBurmon 1-Dec-17 2:20am    
Do they contain same data sets? Can you give us some sample?
Suvendu Shekhar Giri 1-Dec-17 2:29am    
More info required.. share some sample data/column structure.
itsmypassion 1-Dec-17 3:06am    
Please provide table structure and sample data
Richard Deeming 1-Dec-17 12:41pm    
Are you looking for the UNION[^] operator?

1 solution

You can get the output with proper join conditions and using alias names. For example you can check the below query.

Example: Select T1.Column1,T1.Column2,T2.Column2,T2.Column2,T3.Column1,....
From Table T1 Inner Join Tbale T2 on T1.Column1=T2.Column1
Inner Join Table T3 on T3.Column1=T2.Column1
Inner Join Table T4 on T4.Column1=T3.Column2
 
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