Unknown column 'XX' in 'field list'彻底研究

Unknown column 'XX' in 'field list'彻底研究

 

 

对于mysql 插入数据语句:

INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE] [INTO] tbl_name [(col_name,...)] VALUES ({expr | DEFAULT},...),(...),... [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]

或:

INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE] [INTO] tbl_name SET col_name={expr | DEFAULT}, ... [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]

或:

INSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE] [INTO] tbl_name [(col_name,...)] SELECT ... [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]

出现Unknown column 'XX' in 'field list'错误,一般由两种情况引起。

情况一.所要插入的字段根本就不存在。

情况二.要插入的数据不符合存在字段的格式要求。

比如字段要求是varchar 输入的字符串又没有加单引号,就会出现此类错误提示!

另外,对于#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '')' at line 1 错误,一般是SQL语句本身有错误,须仔细检查

你可能感兴趣的:(ibatis)