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 - Displaying JSON data posts for blog using just the post id -

docusignapi - Documents restrictions within a package -

javascript - angular.forEach loop with $http.get -