2011-06-12 29 views
3

在PostgreSQL中我们有VALUES statementPostgreSQL VALUES语句的MySQL模拟?

例如,

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

相当于

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

什么是模拟在MySQL?

+0

第二个块中的select语句。 – Johan 2011-06-12 19:22:55

回答

1

MySQL不支持使用VALUES的(标准)行构造函数。它支持INSERT语句,但不能作为“独立”语句。