if(type=="月报"," and date_format(o.create_time,'%m')='"+ month+"'"+" and date_format(o.create_time,'%Y')='"+ year+"'"," and date_format(o.create_time,'%Y') in ('"+ year+"')")))} 最后的" and date_format(o.create_time,'%Y') in ('"+ year+"')")))} 部分,用mysql, 1个可以,多个报错,查询选2015,2016两个时 日志里Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 ' and date_format(o.create_time,'%Y') in ('2015')and o.enterprise_id=1 AND (SEL' at line 4 为什么还是只有('2015')一个 |
最佳回答 |
||||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|