avatar-decorate
阿莉勒丝黛拉 level
获赞
1220
粉丝
32
关注
11
看过 TA
702
华南农业大学
2024
golang
IP属地:广东
~今宵是飘逸的理想者~
私信
关注
头像
2022-03-05 19:27
华南农业大学 golang
SELECT      order_num,     SUM(item_price * quantity) total_price FROM     OrderItems GROUP BY     order_num HAVING     total_price >= 1000 ORDER BY  &n...
JasonViogd:请问一下,为何我将item_price * 移到sum函数外部就会报错运行不了,就像下面这个样子 SELECT order_num, item_price *SUM(quantity) total_price FROM OrderItems GROUP BY order_num HAVING total_price >= 1000 ORDER BY order_num; 报错如下 SQL_ERROR_INFO: "Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'OrderItems.item_price' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by"
0 点赞 评论 收藏
分享
关注他的用户也关注了:
牛客网
牛客企业服务