开发者

MySQL analog of PostgreSQL VALUES statement?

开发者 https://www.devze.com 2023-03-12 03:21 出处:网络
In PostgreSQL we have VALUES statement. For example, VALUES (1, \'one\'), (2, \'two\'), (3, \'three\');

In PostgreSQL we have VALUES statement.

For example,

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

is equivalent to

SELECT 1 AS column1, 'one' 开发者_JAVA技巧AS column2
UNION ALL
SELECT 2, 'two'
UNION ALL
SELECT 3, 'three';

What is analog in MySQL?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消