SELECT Location
FROM Table1
CROSS JOIN
( VALUES (1),(2),(3),(4)
) AS four(dummy)
Ако 4
не е константа, но (както @xQbert забеляза/попита) е броят редове на таблицата, можете да използвате това:
SELECT a.Location
FROM Table1 AS a
CROSS JOIN
Table1 AS b
Ако нямате Table1
но всяка (колкото и сложна) заявка, можете да използвате това за 4 копия:
SELECT Location
FROM (
SELECT Location --- complex query here
... --- inside parenthesis
UNION
SELECT Country
...
) AS Table1
CROSS JOIN
( VALUES (1),(2),(3),(4)
) AS four(dummy)
или това за n
копия:
WITH cte AS
( SELECT Location --- complex query here
... --- inside parenthesis
UNION
SELECT Country
...
)
SELECT a.Location
FROM cte AS a
CROSS JOIN
cte AS b