select a.ip, b.start_ip, b.end_ip
from a left join b on a.id between b.start_ip and b.end_ip
where b.start_ip is null