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

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -