gpt4 book ai didi

mysql - 如何计算行的总值?

转载 作者:可可西里 更新时间:2023-11-01 08:04:04 25 4
gpt4 key购买 nike

enter image description here

我想要的结果

enter image description here

请帮助我,感谢关注。

最佳答案

您可以将 group by with rollupifnull 一起使用:

select ifnull(customer, 'Total') customer, sum(qty)
from yourtable
group by customer
with rollup

关于mysql - 如何计算行的总值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38603164/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com