如何平均按一组的最低限度
如果我选择每个组的最低限度:
SELECT MIN(price) FROM Products GROUP BY category
如何获得此最小值的平均值?我知道那
SELECT AVG(MIN(price)) FROM Products GROUP BY category
行不通。这里有帮助吗?
If I select the minimum of every group:
SELECT MIN(price) FROM Products GROUP BY category
How can I get the average of this minimums? I understand that
SELECT AVG(MIN(price)) FROM Products GROUP BY category
won't work. Any help here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须找到所有类别的最低限度,然后将平均功能应用于它们。
请参阅 db-fiddle 的结果。
You have to find minimums for all categories and then apply the average function to them.
See the result from db-fiddle.
您需要分两个步骤进行此操作:
You need to do this in two steps: