programming-examples/sql/Subqueries/25. Write a query to display all orders with an amount smaller than any amount for a customer in London.sql

8 lines
289 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*25. Write a query to display all orders with an amount smaller than any amount for a customer in London.*/
SELECT *
FROM orders
WHERE purch_amt <
(SELECT MAX (purch_amt)
FROM orders a, customer b
WHERE a.customer_id=b.customer_id
AND b.city='London');