sediq khan sediq khan - 1 year ago 123
SQL Question

Finding Non Matching ID

I have two tables, called "One" and "Two", they are both the same, table "One" has some IDs that are not there in Table "Two". but when i run this mysql Query, i can not get those non-matching values.

select count(bene) from one where bene not in (select bene from two);

And the result is Zero. so how do i get the non-matching values from Table one that are not there in table Two?

Answer Source
select count(*) from one a where not exists (select * from two b where a.bene=b.bene)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download