sql server 2008 - Unpivot columns to generate rows -
i have query this:
select '35111212', '11245452', '42215512'...... , more values.
this results in:
(no column name) (no column name) (no column name) -------- -------- -------- 35111212 11245452 42215512
and need transform to:
(no column name) -------- 35111212 11245452 42215512
is possible without using "union"? have large amount of values in select.
you can this, if columns named:
select val ( select col1 = '1', col2 = '2', col3 = '3' ) unpivot ( var col in (col1, col2, col3) ) unpvt
Comments
Post a Comment