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
Post a Comment