SELECT Location
FROM Table1
CROSS JOIN
( VALUES (1),(2),(3),(4)
) AS four(dummy)
Hvis 4
er ikke en konstant, men (som @xQbert bemærkede/spurgte) er antallet af rækker i tabellen, kan du bruge dette:
SELECT a.Location
FROM Table1 AS a
CROSS JOIN
Table1 AS b
Hvis du ikke har Table1
men enhver (hvor kompleks) forespørgsel, du kan bruge denne til 4 kopier:
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)
eller dette for n
kopier:
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