我只是使用 MySQL 命令的初学者。我已经搜索过这个错误,但他们的问题与我的不同。我很难理解它所说的错误SELECT list is not in GROUP BY clause and contains nonaggregated column 'japorms.p.item_price' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
我也搜索过的含义,functionally dependent
但仍然无法理解。
这是我的查询:
SELECT
sum(od.item_qty) as item_qty,
p.item_name as item_name,
p.item_price as item_price,
od.size as size
from order_details as od, productmaster as p
where p.id = od.item_id
group by p.item_name
如果我从查询中删除p.item_price
and od.size
,它会接受p.item_name
. 我想知道为什么,因为 p.item_name
和p.item_price
在同一张桌子上。