Help me see what's wrong with the INSERT statement?
Execute this statement insert into Chinaipv4 (from,to) VALUES (' 1.50.0.0 ', ' 1.50.255.255 ');
Always prompt:
Error 1064 (42000): You have a error in your SQL syntax; Check the manual that
Corresponds to your MySQL server version for the right syntax
To) VALUES (' 1.50.0.0 ', ' 1.50.255.255 ') ' in line 1
The table structure is as follows:
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| ID | Int (11) | NO | PRI | NULL | auto_increment |
| from | varchar (16) | YES | | NULL | |
| to | varchar (16) | YES | | NULL | |
+-------+-------------+------+-----+---------+----------------+
------Solution--------------------
MySQL words like this
Insert INTO ' Chinaipv4 ' ("from", ' to ') VALUES (' 1.50.0.0 ', ' 1.50.255.255 ');
------Solution--------------------
From is a MySQL reserved word, and when you move it, you need to escape ' from '
------Solution--------------------
discuss
MySQL words like this
Insert INTO ' Chinaipv4 ' ("from", ' to ') VALUES (' 1.50.0.0 ', ' 1.50.255.255 ');
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service