Reputation: 10483
I need to select few constants as if it was a table. I found similar question for postgress:
Select hardcoded values without table
But it doesnt work with SQLite. This:
select * from (
values (1),(2),(3),(4),(5)
);
returns 1
5 times instead.
How do I fix it?
Upvotes: -1
Views: 503
Reputation: 10483
It seems to be a bug. According to this it worked in previous version of sqlite: How do I name the output column in a sqlite values clause?
However this works as expected:
with cte(a) as (values (1),(2),(3),(4),(5))
select * from cte;
Upvotes: -1