mysql using SUBSTRING_INDEX (string source, string segmentation, the first of several) function ip subnet segment to give

substring_index (dest_str, sep_str, n)
Returns the n th string appears throughout this substring from dest_str before sep_str

-- 测试可使用环境mysql hive sparksql
select substring_index("127.2.3.4",".","3")  -- 就会得到127.2.3 这个字符串,

When the statement is required for feature analysis sub-web gathering

Guess you like

Origin blog.csdn.net/u010720408/article/details/93205591