I have following sql. Works fine for searching IPs. But I also would like to be able so search
select * from table
where (INET_ATON(ip) BETWEEN INET_ATON('10.12.77.1') AND INET_ATON('10.12.77.10') )
limit 30
results is fine
10.12.77.2
10.12.77.5
10.12.77.6
how can I get available IPs like
10.12.77.1
10.12.77.3
10.12.77.4
10.12.77.7
10.12.77.8
10.12.77.9
10.12.77.10
Is it possible to do in mysql, or should I do this in Java?
Thx
Did you try not between :
select * from table
where (INET_ATON(ip) NOT BETWEEN INET_ATON('10.12.77.1') AND INET_ATON('10.12.77.10') )
limit 30
By the way your query is looking 1 to 10, so why limit 30 ? It should be 10.
Regards.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With