SELECT * FROM inventory
WHERE cost >= ALL (SELECT I.price
FROM items I, orders O
WHERE I.o_no = O.o_no);
Each
cost
value in the inventory table is tested against all the
price
values returned by the subquery. Since the operator/keyword is
>= ALL
, if a particular row’s cost value is greater than every single value returned by the subquery, the value expression returns TRUE, and that row is included in the result set.