简体   繁体   中英

INSERT INTO command for type varchar(100) not working?

I am trying to insert data into a table in MySQL, and it is not working. I have two columns, call them A and B, in table x, which are both of type varchar(100) and have no indexes or restrictions. If I type

INSERT INTO x (A) VALUES("testval")

then it works fine, but if I type

INSERT INTO x (B) VALUES("testval")

it gives me an error:

Error in query (1064): Syntax error near 'B) VALUES ("testval")' at line 1

I am not sure but try this

INSERT INTO `x` (`B`) VALUES ('testval')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM