Find median order value
SQL
Hard
5 views
Problem Description
Compute the median of Orders.total_amount.
Sample Test Case
Input:
Orders(total_amount)
Constraints
Median functions vary; show percentile_cont
Official Solution
SELECT PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY total_amount) AS median_order_value FROM Orders;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!