FIRST_SIGNIFICANT_SUBDOMAIN
Descriptionβ
Syntaxβ
VARCHAR first_significant_subdomain(VARCHAR url)
Extract the "first valid subdomain" from a URL and return it. If the URL is invalid, return an empty string.
Exampleβ
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') |
+-----------------------------------------+
| |
+-----------------------------------------+
Keywordsβ
FIRST_SIGNIFICANT_SUBDOMAIN