When I INSERT multiple rows into a MySQL table, will the ids be increment by 1 everytime?

后端 未结 5 413
野趣味
野趣味 2020-12-17 21:06

if I have a query like the following:

INSERT INTO table (col1,col2,col3) VALUES
(\'col1_value_1\', \'col2_value_1\', \'col3_value_1\'),
(\'col1_value_2\', \'         


        
5条回答
  •  粉色の甜心
    2020-12-17 21:43

    If you define any column primary key aut_increment then it will automatically increase value start from 1, you don't need to define this column in insert query then it will automatically insert incremented value in primary key column.

提交回复
热议问题