一条insert语句插入数据库

CREATE TABLE test_main (
id INT NOT NULL,
value VARCHAR(10),
PRIMARY KEY(id)
);

oracle插入方式:
INSERT INTO test_main(id, value)
SELECT 1, 'ONE' FROM dual UNION ALL
SELECT 2, 'TWO' FROM dual;


mysql、postgresql插入方式:
INSERT INTO test_main(id, value) values(1,'one'),(2,'two'),(3,'three');


posted @ 2016-06-27 14:58  Brook Legend  阅读(491)  评论(0编辑  收藏  举报