1.7K Star 11.8K Fork 5.3K

GVP季圣华 / 华夏ERP

 / 详情

数据库中有商品,页面不显示,查看日志报错。

待办的
创建于  
2020-05-07 13:16

Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1:部分单据输入未选择下拉框,会出现报错 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'jsh_erp.jsh_material_extend.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

The error may exist in class path resource [mapper_xml/MaterialExtendMapperEx.xml]

The error may involve defaultParameterMap

The error occurred while setting parameters

SQL: SELECT id, material_id, bar_code, commodity_unit, purchase_decimal, commodity_decimal, wholesale_decimal, low_decimal, default_flag, create_time, create_serial, update_serial, update_time, tenant_id, delete_Flag FROM jsh_material_extend WHERE jsh_material_extend.tenant_id = 63 AND 1 = 1 AND ifnull(delete_Flag, '0') != '1' AND material_id IN (?, ?, ?, ?, ?, ?, ?) GROUP BY material_id

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1:部分单据输入未选择下拉框,会出现报错 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'jsh_erp.jsh_material_extend.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

评论 (3)

洋葱头 创建了任务
洋葱头 关联仓库设置为季圣华/华夏ERP
展开全部操作日志

应该是mysql新版本的问题,我的做法是在mysql conf文件中 在mysqlid里加上

sql_mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION;

这句,去掉only_full_group_by模式就好了。

应该是mysql新版本的问题,我的做法是在mysql conf文件中 在mysqlid里加上
sql_mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION;
这句,去掉only_full_group_by模式就好了。
正解
@逐风林羽

去掉GROUP BY material_id。没啥用,感觉。
“去掉only_full_group_by模式”的解决方案并不优雅,不建议使用。
sql不符合标准就应该改掉。

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(4)
Java
1
https://gitee.com/jishenghua/JSH_ERP.git
git@gitee.com:jishenghua/JSH_ERP.git
jishenghua
JSH_ERP
华夏ERP

搜索帮助