How to use the insert statement insert into in MySQL
This article will explain in detail how to use the insert sentence insert into in MySQL. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Insert statement
Syntax:
Insert into table name (field name, field name...) Values (value 1, value 2...)
Mysql > insert into users (id,username,password, `add`, age) values (null,'lranyu','123456',' Fuzhou', 19); mysql > insert into users values (null,20,'qingyu','hihiih88',' Xiamen'); mysql > insert into users values (null,'18','newlran','13242ds',default)
Summary:
1. The order of inserting fields can be inconsistent with that of database fields.
two。 The order of the number of inserted values must be the same as the order of the number of field names inserted.
3. When the number and order of inserted values are the same as the number and order of fields in the table, the inserted fields can be omitted
4. Auto-grow columns, which can be inserted directly into null
5. Insert default values with default
This is the end of the article on "how to use insert into in MySQL". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.