sql server - Split Microsoft SQL Row -


assume have data so:

+------+------+------+------+ | col1 | col2 | col3 | col4 | +------+------+------+------+ |    | b    | x    | y    | +------+------+------+------+ 

i wish split after column achieve this:

+------+------+ | col1 | col2 | +------+------+ |    | b    | | x    | y    | +------+------+ 

what easiest way achieve this? forced in old ms access database connection sql server. thoughts?

use union all:

select col1, col2 t union select col3, col4 t; 

both databases support union all. both take column names first subquery.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -