当前位置: 代码迷 >> Java Web开发 >> 仔细看了下sql语句还是报You have an error in your SQL syntax; 这个异常
  详细解决方案

仔细看了下sql语句还是报You have an error in your SQL syntax; 这个异常

热度:763   发布时间:2016-04-16 21:59:15.0
仔细看了下sql语句还是报You have an error in your SQL syntax; 这个错误
用的mysql
check the manual that corresponds to your MySQL server version for the right syntax to use near 'and f.opt_date between '2014-08-01' and '2014-08-11'  limit 0,3' at line 1

如图

------解决方案--------------------
syntax to use near 'and f.opt_date between '2014-08-01' and '2014-08-11'  limit 0,3' at line 1 
这句话表示,最有可能发生错误的应该是没有显示出来的你的sql语句的前半部分,
至少应该满足这样的基本逻辑 'select * from t_table where 1=1'  如果你的前半部分只是‘select * from t_table where’那么报错是一定的了
  相关解决方案