Home  >  Q&A  >  body text

Isn’t the ID primary key auto-incrementing? Why do we need to add null?

insert into stu values ​​(null,'jike','ww',55)

Why should the id field be null when inserting? Can it not be written? I tried it, but it doesn't work! Since it is Why can't it be done without writing the self-increasing number?

红色熊猫红色熊猫2063 days ago1248

reply all(2)I'll reply

  • 「梦想启航」

    「梦想启航」2019-02-25 11:32:50

    insert into my_table (field 1, field 2....) values ​​(...), this insertion method can be omitted without writing the primary key field name, insert into mytable values ​​(), this kind of insertion requires each field to be There must be a value entered, otherwise, sorry, there is an error.

    reply
    1
  • Cancelreply