You can also "select" literal values:
mysql> select 'hello', 1; +-------+---+ | hello | 1 | +-------+---+ | hello | 1 | +-------+---+ 1 row in set (0.00 sec)
Therefore, you can also use this in INSERT INTO ... SELECT FROM and UNION s.
INSERT INTO someTable (a, b, c) VALUES SELECT id, name, 5 FROM someOtherTable UNION SELECT id, alias, 8 FROM anotherTable
source share