Convert SQL columns to rows

rows, sql-server

Solution

SELECT 1
UNION
SELECT 2
UNION
SELECT 3

Problem

I would like to split one records columns into multiple rows. If I have a SQL statement like the following: ``` SELECT 1,2,3 ``` Result: ``` 1 | 2 | 3 ``` How do I convert that to the following result? ``` 1 2 3 ``` I am currently using MS SQL 2008.

Original source

Related problems