Tuesday, January 19, 2010

Insert multiple rows into a table

DROP TABLE IF EXISTS tbl_test;
CREATE TABLE tbl_test(a varchar(10), b int);
INSERT INTO tbl_test(a, b)
VALUES
('Name 1', 1),
('Name 2', 2),
('Name 3', 3),
('Name 4', 4);
SELECT * FROM tbl_test;

No comments:

Post a Comment