MySQL: Multiple Inserts for a single column

前端 未结 2 712
刺人心
刺人心 2021-02-05 21:13

I\'m looking for a way to do multiple row inserts when I\'m only inserting data for a single column.

Here is the example table:

+-------+-------------+--         


        
2条回答
  •  Happy的楠姐
    2021-02-05 21:34

    your syntax is a bit off. put parentheses around each data "set" (meaning a single value in this case) that you are trying to insert.

    INSERT INTO User_Roll(name) VALUES ('admin'), ('author'), ('mod'), ('user'), ('guest');
    

提交回复
热议问题