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
This is a good way if you need a long list (so you don't need lots of UNIONstatements:
UNION
WITH CTE_Numbers AS ( SELECT n = 1 UNION ALL SELECT n + 1 FROM CTE_Numbers WHERE n < 10 ) SELECT n FROM CTE_Numbers