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

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -