MySQL: Select from coma separated list / list as table? "SELECT a FROM (1, 2, 3)"
mysql, select, sql
Solution
SELECT 1 a UNION ALL SELECT 2 a UNION ALL SELECT 3 a;
Problem
Is it possible to do something like this (obviously this syntax does not work): ``` SELECT a FROM (1, 2, 3) ``` to get this: ``` | a | +---+ | 1 | | 2 | | 3 | ``` ? That is I want to make rows from coma separated list, without using any table, or at least without creating table in db (maybe this is possible using something like temporary table?). Maybe it is possible to get column of given values without using select, that is using some other sql statment? If it is not possible in MySQL, but possible in some other SQL it still would be interesting to know.