I need to mount a very simple select, but I'm having trouble.
SELECT SEQPRODUTO
FROM MRL_PRODUTOEMPRESA
WHERE STATUSCOMPRA = 'I'
AND NROEMPRESA IN (1,2,3,4,5,6,7,8,9,11,13,14)
I need to select the products where STATUSCOMPRA = 'I'
in all companies within the following list.
But I only need the items that are inactive in ALL the companies on that list.
Using IN
as I did, the result can bring products that are inactive only to a company in that list.
I believe the IN
operator is not the correct one for what I want.