题解 | #提取博客URL中的用户名#
提取博客URL中的用户名
https://www.nowcoder.com/practice/26c8715f32e24d918f15db69518f3ad8
select
device_id,
substring_index (blog_url, "/", -1) as user_name
from
user_submit
- 主要是substring_index函数的运用
- substring_index(content,'分隔符',索引)
- 如:www.wyj.con,substring(url,'.'1)-->www
- www.wyj.con,substring(url,'.'2)-->www.wyj
- www.wyj.con,substring(url,'.'-1)-->com
查看28道真题和解析