Insert tone belongs to DML
Simple usage: INSERT INTO tb_name (field 1, Field 2, ...) VALUES (value 1, value 2, ...) Attentionthe number of fields must be the same as the number of values。 Characters are quoted in quotation marks, numbers are not used, inserting null values using NULL BULK INSERT: INSERT INTO tb_name (field 1, Field 2, ...) VALUES (value 1, value 2, ...) [, (Value N, value m, ...),.............] Note the comma. The inserted value is not necessarily the value we give, or the expression can be used. For example, if you write 1+2 MySQL will calculate the results, the Insert field can also use the INSERT into Tb_name set set tone similar to the update tone. For example, insert into text set a1=10,a2=11; In the field, A1,a2 inserts the last field in the Data query table select * FROM Tb_name the order by field name DESC LIMIT 1 This indicates that the results of the query will be dropped The sequence display. Then use limit 1 to display the first lineInsert the results of a query in one table into another table, provided that the fields correspond. For example, we query the age field in the student table students, more than 20 of the student name, gender, age, insert Tutors table field, name, age, gender insert into tutors (tname,gender,age) Select Name, Gender,age from students where age>20; inserts data, if the original table is not inserted, there is a replacement. Use replace into and insert the same usage.
MySQL Insert tone Common manual