I'm doing a query to get ip addresses given a range, for example:
Obtain the ip's that are between 192.168.0.0 and 192.168.0.255
The query I'm using is:
SELECT dir_ip
FROM nic
WHERE dir_ip
BETWEEN '192.168.0.0' AND '192.168.0.255'
ORDER BY dir_ip
The ip addresses are stored as text in the database, the problem with that query is that I do not know why it does not return all the ip addresses, which in total should be 256 and it only brings me 177 in total.
What query could you make to get all the ip's within the given range?