我有一个带主键的父表generic_Catalog “ PART号
使用“零件号”链接到子表“ Drop_Material” 作为外键。 DROP_Material可能与 相同的“ PART-NUMBER”
我将表连接在一起以从generic_catalog获取信息 以获得零件上的说明信息
当我使用WITH ROLLUP函数获得总计时,我得到
错误代码:1055。SELECT列表的表达式#2不在GROUP BY子句中,并且包含未聚合的列'infrastructure.gc.material_desc',该列在功能上不依赖于GROUP BY子句中的列;这与sql_mode = only_full_group_by“
不兼容如果我没有汇总功能,我不会收到错误消息
select
gc.generic_Part_number,
gc.material_desc as Discription,
gc.material_Cost_est,
sum(dm.qty)
from generic_catalog as gc
left Join drop_material as dm on
gc.generic_Part_number = dm.generic_catalog_generic_Part_number
where dm.Wall_Drop_Wall_rooms_Residence_residence_id = 'Bacara Lot 223'
group by gc.generic_Part_number with rollup
;