select from values in mysql

From the link you provided :

VALUES (1, ‘one’), (2, ‘two’), (3, ‘three’);
This will return a table of two columns and three rows. It’s effectively equivalent to:
SELECT 1 AS column1, ‘one’ AS column2
UNION ALL
SELECT 2, ‘two’
UNION ALL
SELECT 3, ‘three’;

So you need

select * from 
table1,
(
   SELECT 1 AS val
   UNION ALL
   SELECT 2
   UNION ALL 
   SELECT 3 
)b

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)