查询避免Unknown column ‘xxx’ in ‘where clause_unknown column 'accreadonly in-CSDN博客

网站介绍:文章浏览阅读6.5w次,点赞25次,收藏26次。问题:单从字面理解,我们很容易得出列名称不存在的结论,但是,很多时候并不是列名出错造成的,而是由于拼凑sql语句时对字符类型数据没有用引号引起来造成的。例子: 例如: String sql="select age from user where name="+xxx+"; 设置name的值为columName,则错误如下: Unk..._unknown column 'accreadonly in