This MySQL function converts an Internet Protocol (IP) address in dot-quad notation to its numeric equivalent.
Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).
This function converts an Internet Protocol (IP) address in dot-quad notation to its numeric equivalent. The function INET_NTOA( ) can be used to reverse the results.
SELECT INET_ATON('220.127.116.11') AS 'AT&T'; +-----------+ | AT&T | +-----------+ | 209654088 | +-----------+
This function is useful in sorting IP addresses that lexically might not sort properly. For instance, an address of 10.0.11.1 would come after 10.0.1.1 and before 10.0.2.1 under normal sort conditions in an ORDER BY clause.