Because of the preliminary design problems, when saving the ip address, it is not stored as an integer, but saved as a string. When querying the ip range, this problem occurs: selectipfromt_ipwhereipbetween192.168.11.1and192.168.11.150, when the last IP address is three digits, no data can be found.
Because of the preliminary design problems, when saving the ip address, it is not stored as an integer, but saved as a string. When querying the ip Range, this problem occurs: select ip from t_ip where ip between' 192. 168.11.1 'and' 192. 168.11.150 ', when the last IP address is three digits, no data can be found
<无>
Due to the preliminary design problems, when saving the ip address, it is not stored as an integer, but saved as a string. When querying the ip Range, this problem occurs: select ip from t_ip where ip between' 192. 168.11.1 'and' 192. 168.11.150 ', when the last IP address is three digits, no data can be found. Check that mysql comes with an inet_aton function that processes IP addresses. The function is mainly to provide a "Point address" (such as 127.0.0.1) representation of the network address that acts as a string, returns an integer representing the value of the address. The number generated is in the byte order. The preceding statement is changed to: select ip from t_ip where inet_aton (ip) between inet_aton ('192. 168.11.1 ') and inet_aton ('192. 168.11.150') to effectively compare the data.