In standard SQL, is there a way to say:
select mubmle as x from mumblemmble
And get more than one line of results, like this
x
_
1
2
3
without creating temporary tables? I can do it in SQL Server using row_count() if I know some table that has enough rows, like:
select row_number() over (order by x.SomeColumn) from
(select top 24 SomeColumn from TableThatHasAtLeast24Rows) x
But wonder if there’s a standard (less dumb) way to do it.
There is no standard way, and no way at all in
MySQL.In
Oracle:In
MS SQL:In
PostgreSQL:Note that
MS SQL, unlikeOracle, cannot swap recursion stack into temporary tablespace, so you may experience troubles when generating large datasets.See this answer for more details