Welcome Back

Google icon Sign in with Google
OR
I agree to abide by Pharmadaily Terms of Service and its Privacy Policy

Create Account

Google icon Sign up with Google
OR
By signing up, you agree to our Terms of Service and Privacy Policy
Instagram
youtube
Facebook

Find the Maximum Quantity Sold in Any Order

Find the Maximum Quantity Sold in Any Order
OrderDetails Table:

Query Explanation:

  • MAX(Quantity) is an aggregate function that returns the highest value in the Quantity column of the OrderDetails table.

  • AS MaxQuantitySold gives the output column a meaningful alias.

  • This query checks all the order details and tells you which single item in any order had the highest quantity sold.

SQL Query:

SELECT MAX(Quantity) AS MaxQuantitySold
FROM OrderDetails;

Output: