• Stewart "Arturius" Campbell - Friday, February 23, 2018 3:44 AM

    sipas - Friday, February 23, 2018 3:06 AM

    What would the correct syntax be, to generate a table of numbers 1 to 10?

    If done using a recursive CTE, then with cnumbers as
    (
    select 1 as i
    union all
    select i+1
    from cnumbers
    where i < 10
    )
    select i
    from cnumbers;

    However, much better performance would be obtained using  a tally table...

    Thank you very much.