Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
250 views
in Technique[技术] by (71.8m points)

sql - How to convert address in IPv6 to number using Vertica

I have a table in Vertica db with column ip of type string that holds both formats of ipv4 and ipv6. I need to transform the string representation of the ip to a number as it is done for example here - https://www.ipaddressguide.com/ipv6-to-decimal

To deal with ipv4 Vertica has built in function: inet_aton() https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Functions/String/INET_ATON.htm

SELECT INET_ATON('1.2.3.4');
 inet_aton 
-----------
  16909060

I'm looking for the same functionality to convert ipv6 address to number: IP address 2001:569:7c0e:5700:1133:9bbd:232f:9c78 is equal to 42540597931374402043102832032222256248


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...