Sql Refresher # 3

Problem : Select second highest quantity ordered by any customer

Solution: 

select quan.quantity from ( SELECT DISTINCT order_details.quantity from order_details ORDER BY quantity DESC) as quan LIMIT 1,1;

Comments