I wish to sort a list of IP address.
Is there any function in Postgresql to use with the order by like INET_ATON in MySql ?
My current IP is on string format.
You can order your IP address column IP_Address
with something like this:
SELECT * FROM MyTable ORDER BY inet(IP_Address)
See the documnetation for further reference.
Edit:
This is actually not a function but a type cast to the postgres integrated type for IP addresses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With