1.错误源头
Error querying database. Cause:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'cis.q1.query_date'
which is not functionally dependent on columns in GROUP BY clause;
this is incompatible with sql_mode=only_full_group_by
- 1
- 2
- 3
- 4
- 5
通过报错信息可以看到是 sql_mode=only_full_group_by 问题,
于是我们在mysql命令行输入:select @@sql_mode 查询当前数据库的默认sql_mode: