0

There is no any specific area to add this problem of mine. Thats why i add this in to windows server area.
This is a SQL problem.
I want to combine 2 columns in to one column (2 columns are in 2 tables).
There are a lot of codes in the internet. But i couldnt find a proper code what i want.

Some of code in the internet.
Eg: ([Column_1] + ' ' + [Column_2])
this join 2 colums like this.

 Column_1             Column_2
 A                       X
 B                       Y
 C                       Z

with above code it is shown the column like this

A X
B Y
C Z

But i want to get these 2 columns like this

A
B
C
X
Y
Z

PLEASE SHOW ME A DIRECTION TO DO THIS....

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by SyncMaster170
0

Hello,

Try a union statement and do two seperate queries :

Select column_1 as mycolumn from table1
union
select column_2 as mycolumn from table2
0

This would actually only be one query:

SELECT column_1 as myNewColumn from table1
UNION
SELECT column_2 as myNewColumn from table2

Once again, this is a SINGLE QUERY STATEMENT,highlight the whole statement and execute. Enjoy.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.