Reputation: 2441
I'm looking for an alternative to this in MySQL https://stackoverflow.com/a/13494329
SQL query:
SELECT tempId
FROM (
VALUES(1),(2),(3)
) V(tempId)
Result:
tempId
1
2
3
Upvotes: 0
Views: 61
Reputation: 175586
For equivalent of Table Value Constructor in MySQL
you can use UNION ALL
:
SELECT tempId
FROM (
SELECT 1 AS tempId
UNION ALL SELECT 2
UNION ALL SELECT 3
) V
Upvotes: 1