I have 2 MySQL tables:
id customer ipAddress -------------------------- 1 acme 10.10.10.10 2 target 33.33.33.33 number ip -------------------- 54321 10.10.10.10 41247 33.33.33.33 62068 77.77.77.77 In this case, 77.77.77.77 has no entries in table 1.
How can I get all the numbers in table 2 that do not have an ipAddress in table 1?
I have tried:
select ip from table1,table2 where ip not in(select ipAddress from table1); but I get an empty set.
select ip from table1,table2to thisselect ip from table2. You don't need the extra join totable1in theFROMclause.