I can use SQLite's built-in generate_sequence function to create a series of values with a known (constant) lower and upper bound:
sqlite> select value from generate_series(1, 5);
1
2
3
4
5
How do I generate such a sequence if the lower and upper bounds must be based on values from some table? For example, suppose I have:
sqlite> create table temp(
......> num integer not null
......> );
sqlite> insert into temp values (1), (5);
sqlite> select * from temp;
1
5
The following (quite reasonably) gives a parse error:
sqlite> select value from generate_series(
......> select min(num) from temp,
......> select max(num) from temp
......> );
Is it possible to do what I want without using a recursive CTE? (My actual use case requires a series of dates based on the minimum and maximum dates in a dataset, but if I can get a series of integers, generating dates will be straightforward.)