SQL statement inserted into inset into error unrecognized token:

Recently, I encountered such a problem when inserting data into a table using sql statements: unrecognized token:
I checked the data because I didn't pay attention to a detail. The INSERT INTO statement can be written in two forms.

The first form does not need to specify the name of the column to insert the data into, just provide the value to be inserted:

INSERT INTO table_name
VALUES (value1,value2,value3,…);
The second form requires specifying the column name and the value to be inserted:

INSERT INTO table_name (column1,column2,column3,…)
VALUES (value1,value2,value3,…);`
1, if the data of each column is inserted, use the first type, if only some columns are inserted, use the second type
, 2 , it should be noted that the data that needs to be inserted after the values ​​should be enclosed in single quotes **''**, otherwise the error mentioned above will appear.

实例
INSERT INTO Websites (name, url, alexa, country)
VALUES ('百度','https://www.baidu.com/','4','CN');

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324133011&siteId=291194637