Is there a way of selecting a specific number of rows without creating a table. e.g. if i use the following:
SELECT 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Using PIVOT (for some cases it would be overkill)
DECLARE @Items TABLE(a int, b int, c int, d int, e int); INSERT INTO @Items VALUES(1, 2, 3, 4, 5) SELECT Items FROM @Items as p UNPIVOT (Items FOR Seq IN ([a], [b], [c], [d], [e]) ) AS unpvt