IPV4_STRING_TO_NUM
Description
The IPV4_STRING_TO_NUM function is used to convert an IPv4 address from its string form to an internally used 64-bit integer (bigint) format. This is useful for performing numerical comparisons and calculations based on IP addresses.
Parameter Description
- expr: string type, representing the IPv4 address string to be converted.
Return Result
- Returns a 64-bit integer (bigint) representing the numerical value corresponding to the input IPv4 address string.
Example
- Convert the local loopback address to a numerical value:
- Compare two IPv4 addresses numerically:
- Calculate the number of hosts within an IPv4 address range:
Through the above example, you can see the flexibility and practicality of the IPV4_STRING_TO_NUM function when handling IPv4 addresses. This function can help you perform numerical calculations and comparisons related to IP addresses more conveniently.