We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b167142 commit 55dbfa6Copy full SHA for 55dbfa6
1867-orders-with-maximum-quantity-above-average.sql
@@ -0,0 +1,10 @@
1
+# Write your MySQL query statement below
2
+select order_id from OrdersDetails
3
+group by order_id
4
+having max(quantity) > (
5
+ select max(avg_quantity) from
6
+ (select order_id, sum(quantity) / count(product_id) as avg_quantity
7
+ from OrdersDetails
8
+ group by order_id
9
+ ) t
10
+);
0 commit comments