How to generate a table in SQL having sequence numbers from 0 to a max value
<p>I am currently using </p>

<pre><code>SET @startnum = 0;
SET @endnum = 10;

WITH n AS (
SELECT @startnum AS num
UNION ALL
SELECT @startnum +1 FROM n WHERE @startnum &lt; @endnum
)
SELECT num FROM n ORDER BY num;
</code></pre>

<p>But the version of SQL that I am using doesn't support "With table" query.
Also, I am not able to use <code>row_number()</code> or <code>rank_over()</code> partition by functions.</p>