Question

I have some dates in a table and i need a query that the dates in the table are different to the second table, i am intenting with this:

http://sqlfiddle.com/#!2/a1308/2

But it now works

I need for example in the first table:

3202024834
3108984111
3118545645
4608389
2631993
9876534
3114568970

and in other

3202024834
3108984111
3118545645

Then the output of the query is:

4608389
2631993
9876534
3114568970
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top