sql - MySQL Query to Read Out Data in IP Blocks? -


i have bunch of data stored in mysql database column called 'ip', , each record in ip table ipv4 address has been inet_aton'd.

example:

enter image description here

i'd read out data clause matches record such ip resolves in range:

10.0.0.0 - 10.0.255.255

any ideas on how tackle this?

select * table ip>=inet_aton('10.0.0.0') , ip<=inet_aton('10.0.255.255') 

Comments