Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello,

I am trying to add two separated Query result from two different column

What I have tried:

Query1="select column from table1" 
Query2="select column from table1"

Result:
table should be like this
Col1-Query1  Col2-Query2
    1              1
    2              2
    3              3
Posted
Updated 23-May-17 11:49am
v2
Comments
Michael_Davies 23-May-17 15:06pm    
Have you looked at using a UNION?
Amar P Sutar 23-May-17 15:24pm    
Yes sir I was used union but it will combine data from two column in one
ZurdoDev 23-May-17 15:36pm    
You need to join the tables. If they cannot be joined then you might look into UNION and then PIVOT.
Amar P Sutar 23-May-17 15:25pm    
but i want to two different columns
CHill60 23-May-17 15:48pm    
What you have shown is getting the same column from the same table twice.
I'm fairly sure that isn't really what you want.
Why not give a real example so we can see what you mean

1 solution

All you need to do is to read about Visual Representation of SQL Joins[^]. Depending on situation you may want to use INNER or LEFT or RIGHT or CROSS JOIN.
 
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