I am interpreting your question as "Get values in a
that are not in b
". If so, a good way to approach this is with a left outer join
along with a where
clause:
select a.msisdn
from msisdn a left outer join
insertados b
on a.msisdn = b.numero
where b.numero is null;
The data is the SQLFiddle doesn't exactly match the data in the question, so the results are a bit different from what is in the question.