跳到主要内容
跳到主要内容

FIRST_SIGNIFICANT_SUBDOMAIN

描述

语法

VARCHAR first_significant_subdomain(VARCHAR url)

在 URL 中提取出“第一个有效子域”返回,若不合法则会返回空字符串

mysql [(none)]>select first_significant_subdomain("www.baidu.com");
+----------------------------------------------+
| first_significant_subdomain('www.baidu.com') |
+----------------------------------------------+
| baidu |
+----------------------------------------------+

mysql [(none)]>select first_significant_subdomain("www.google.com.cn");
+--------------------------------------------------+
| first_significant_subdomain('www.google.com.cn') |
+--------------------------------------------------+
| google |
+--------------------------------------------------

mysql [(none)]>select first_significant_subdomain("wwwwwwww");
+-----------------------------------------+
| first_significant_subdomain('wwwwwwww') |
+-----------------------------------------+
| |
+-----------------------------------------+

关键词

FIRST_SIGNIFICANT_SUBDOMAIN