1867. Orders With Maximum Quantity Above Average
https://leetcode.com/problems/orders-with-maximum-quantity-above-average
Description
Table: OrdersDetails
You are running an ecommerce site that is looking for imbalanced orders. An imbalanced order is one whose maximum quantity is strictly greater than the average quantity of every order (including itself).
The average quantity of an order is calculated as (total quantity of all products in the order) / (number of different products in the order)
. The maximum quantity of an order is the highest quantity
of any single product in the order.
Write an SQL query to find the order_id
of all imbalanced orders.
Return the result table in any order.
The query result format is in the following example:
ac
Previous1866. Number of Ways to Rearrange Sticks With K Sticks VisibleNext1868. Product of Two Run-Length Encoded Arrays
Last updated