-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
商品信息查询报错 #85
Comments
明白,你可以改下mysql的参数,可以支持这个sql的
…------------------ 原始邮件 ------------------
发件人: "jishenghua/jshERP" ***@***.***>;
发送时间: 2023年3月30日(星期四) 上午10:51
***@***.***>;
***@***.***>;
主题: [jishenghua/jshERP] 商品信息查询报错 (Issue #85)
SQL: SELECT m.*, u.name unitName, mc.name categoryName, me.bar_code, me.purchase_decimal, me.commodity_decimal, me.wholesale_decimal, me.low_decimal, me.sku FROM jsh_material m LEFT JOIN jsh_material_extend me ON me.tenant_id = 63 AND m.id = me.material_id AND ifnull(me.delete_Flag, '0') != '1' LEFT JOIN jsh_unit u ON u.tenant_id = 63 AND m.unit_id = u.id AND ifnull(u.delete_Flag, '0') != '1' LEFT JOIN jsh_material_category mc ON mc.tenant_id = 63 AND m.category_id = mc.id AND ifnull(mc.delete_Flag, '0') != '1' WHERE m.tenant_id = 63 AND 1 = 1 AND (me.bar_code LIKE ? OR m.name LIKE ? OR m.standard LIKE ? OR m.model LIKE ?) AND ifnull(m.delete_flag, '0') != '1' GROUP BY m.id ORDER BY m.id DESC LIMIT ?, ?
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #24 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'erp.me.bar_code' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #24 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'erp.me.bar_code' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
应该是对应sql(MaterialMapperEx.xml -> selectByConditionMaterial)中group by的列名不全GROUP BY m.id后面加上u.name, mc.name, me.bar_code, me.purchase_decimal, me.commodity_decimal, me.wholesale_decimal, me.low_decimal, me.sku就好了
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
好的,谢谢。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
应该是对应sql(MaterialMapperEx.xml -> selectByConditionMaterial)中group by的列名不全GROUP BY m.id后面加上u.name, mc.name, me.bar_code, me.purchase_decimal, me.commodity_decimal, me.wholesale_decimal, me.low_decimal, me.sku就好了
The text was updated successfully, but these errors were encountered: