0
Let’s say I have the table CON_CONTRATOS
and in it I have con_customerId
, con_vencimento
among others. And I need to make a select that returns ALL contracts of a Costomer whose same only contract with con_vencimento not null
. That is, if he has a contract with con_expiration null, he returns nothing. I tried to do this using not in
, but I did not succeed. I had tried 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);
I didn’t understand your question. By only the
WHERE con_vencimento IS NOT NULL
doesn’t answer your case?– rbz
Pq, this would return the contracts that are not null, even if it has at least 1 null, in case I need it to return, only if none of the contracts of the same is null
– Prostetnic Vogon Jeltz