unknow

unknown column in where clause
数据库

unknown column in where clause

37 0

但凡写过sql语句的人估计都曾经碰到过类似于Unknown column ‘xxx’ in ‘where clause’的问题。 单从字面理解,我们很容易得出列名不存在的结论。这说明sql语句编写不正确,需要进行检查、修改。但是,很多时候起始并不是由于列名出错造成的。(推荐学习:MySQL视频教程)而是由于拼凑sql语句时对字符类型数据没有用引号引起来造成的。例子:1String sql="select age from user where name="+xxx+";设置name的值为columName