|
INSERT STATEMENT FOR MULTIPLE ROWS :
We can insert multiple rows into a table using a single INSERT statement.
The Syntax is
INSERT INTO tbl_name(col_name1, col_name2,...) VALUES(expr1, expr2,.....;), (expr1a, expr2a,.....;)
Example :
mysql> insert into student(studid,name,marks,address,phone)
values(3,'michael',75,'edinburgh',2598234),
(4,'jack',82,'victoria street',2436821),
(5,'anne',100,'downing street',2634821);
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0
The above query will insert the three students details into the table student. This query will be useful while inserting large amount data into a specific table.
|