I have created the following tables:
productstest
orders
The query is as follows:
SELECT nombre
FROM productostest
WHERE id = ALL (SELECT idProducto FROM pedidos WHERE cantidad > 0);
This query does not return any results. What is the reason? for all idProductos it is true that they have quantities greater than 0.
According to the documentation:
The word ALL , which should follow a comparison operator, means "returns TRUE if the comparison is true for all values in the column that returns the subquery ".