言語
サーバ関連
ツール
API
読み物
その他
[AD]
VALUESをカンマ(,)で区切って指定するだけです。
INSERT INTO `テーブル名` (id, name) VALUES (1, 'foo') , (2, 'bar') , (3, 'hoge');
通常のINSERTと同様に、すべての列に順番通りデータを追加する場合はカラム名の記述は不要です。
INSERT INTO `テーブル名` VALUES (1, 'foo') , (2, 'bar') , (3, 'hoge');
mysql> insert into test(id, name) -> values (1, 'foo') -> , (2, 'bar') -> , (3, 'hoge'); Query OK, 3 rows affected (0.01 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> select * from test; +----+------+ | id | name | +----+------+ | 1 | foo | | 2 | bar | | 3 | hoge | +----+------+ 3 rows in set (0.00 sec)