5 Mayıs 2015 Salı

generate numbers with recursive cte

;WITH Numbers AS

(

    SELECT n = 1

    UNION ALL

    SELECT n + 1

    FROM Numbers

    WHERE n+1 <=10

)

SELECT

       n

FROM Numbers

OPTION (MAXRECURSION 1000)

Hiç yorum yok:

Yorum Gönder