Insert more than one rows in a single insert statement : Insert : Insert Update Delete MySQL TUTORIALS


MySQL TUTORIALS » Insert Update Delete » Insert »

 

Insert more than one rows in a single insert statement


mysql>
mysql>
mysql> CREATE TABLE employee (
    ->      id MEDIUMINT NOT NULL AUTO_INCREMENT,
    ->      name CHAR(30NOT NULL,
    ->      PRIMARY KEY (id)
    ->  );
Query OK, rows affected (0.01 sec)

mysql>
mysql> INSERT INTO employee (nameVALUES ('A'),
    ->                                    ('B'),
    ->                                    ('C'),
    ->                                    ('D'),
    ->                                    ('E'),
    ->                                    ('F');
Query OK, rows affected (0.00 sec)
Records: 6  Duplicates: 0  Warnings: 0

mysql>
mysql> SELECT FROM employee;
+----+------+
| id | name |
+----+------+
|  | A    |
|  | B    |
|  | C    |
|  | D    |
|  | E    |
|  | F    |
+----+------+
rows in set (0.00 sec)

mysql>
mysql> drop table employee;
Query OK, rows affected (0.00 sec)

mysql>
mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Insert Update Delete
» Insert