What is a fast/readable way to SELECT a relation from \"nothing\" that contains a list of numbers. I want to define which numbers by setting a start and end value. I am usi
Well in SQL server (and PostgreSQL) I would use recursive common table expression: SQL Server, PostgreSQL
with recursive Numbers as (
select 0 as Number
union all
select Number + 1
from Numbers
where Number < 4
)
select Number
from Numbers
SQL FIDDLE EXAMPLE
But, as far as I know, there's no WITH in SQLite.
So, the possible solutions could be
create a table with numbers from 0 to max number you'll ever need, and then just select from it like this:
select Number from Numbers where Number >= 0 and Number <= 4