Score
0
Watch 1.1K Star 4.4K Fork 2.2K

季圣华 / 华夏ERPJavaGPL-3.0

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

Open
洋葱头  Opened this issue

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

total 4 participants

Comments (3)

逐风林羽 2020-05-13 12:40

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

sql_mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION;

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

fengyelingdu 2020-05-16 22:17

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

slipdaly 2020-09-21 13:22

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

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority