Let's say I have the CON_CONTRATOS
table and I have con_customerId
, con_vencimento
among others. And I need to do a select that returns me ALL the contracts of a customer whose contract is only with con_vencimento not null
. That is, if it has a contract with null conformation, it returns nothing. I tried doing this using not in
, but I did not succeed. I had tried it this way:
SELECT con_customer
FROM con_contratos
WHERE con_vencimento IS NOT NULL
AND NOT EXISTS (SELECT * FROM con_contratos WHERE con_vencimento IS NULL);