Use the keyword ALL preceding a subquery to determine
whether a comparison is true for every value returned. If the subquery
returns no values, the search condition is true. (If it returns
no values, the condition is true of all the zero values.)
The
following query lists the following information for all orders that
contain an item for which the total price is less than the total price
on every item in order number 1023.Figure 1. Query
SELECT order_num, stock_num, manu_code, total_price
FROM items
WHERE total_price < ALL
(SELECT total_price FROM items
WHERE order_num = 1023);