1

例如,有没有办法执行以下操作:

INSERT INTO table2 VALUES(SELECT x FROM table1 WHERE x > 5 LIMIT 4)
4

2 回答 2

8

删除 VALUES 和括号:

INSERT INTO table2 SELECT x FROM table1 WHERE x > 5 LIMIT 4
于 2009-02-12T20:43:00.520 回答
2
INSERT INTO SomeTable(column1, column2, column5)
SELECT x as column1, y as column2, a as column5
FROM differentTable
WHERE ....
于 2009-02-12T20:46:09.200 回答