Ja, du kan bruge en rekursiv CTE at gøre dette. For eksempel for at generere tal mellem 10 og 20 inklusive:
WITH f AS
(
SELECT 10 AS x
UNION ALL
SELECT x + 1 FROM f WHERE x < 20
)
SELECT * FROM f
Ja, du kan bruge en rekursiv CTE at gøre dette. For eksempel for at generere tal mellem 10 og 20 inklusive:
WITH f AS
(
SELECT 10 AS x
UNION ALL
SELECT x + 1 FROM f WHERE x < 20
)
SELECT * FROM f