SQL Server: merge multiple columns into 1 column

advertisements

Hey there I have 2 tables with each multiple columns and i want to merge them in a view with 1 column.

table1

data1    data2     data 3
lala     blabla    aaa

table2

data1    data2     data 3
qqq      wwww      eee

into 1 view with 1 column

merged view

data1
lala
blabla
aaa
qqqq
wwww
eee

I'm using SQL Server, anyone has an idea :)


select data1 from table1
union all
select data2 from table1
union all
...
select data3 from table2