Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL analog of PostgreSQL VALUES statement?

Tags:

mysql

In PostgreSQL we have VALUES statement.

For example,

VALUES (1, 'one'), (2, 'two'), (3, 'three');

is equivalent to

SELECT 1 AS column1, 'one' AS column2
UNION ALL
SELECT 2, 'two'
UNION ALL
SELECT 3, 'three';

What is analog in MySQL?

like image 719
dvv Avatar asked Jan 25 '26 18:01

dvv


1 Answers

MySQL does not support the (standard) row constructor using VALUES. It is supported for an INSERT statement, but never as a "standalone" statement.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!