题解 | #提取博客URL中的用户名#

提取博客URL中的用户名

https://www.nowcoder.com/practice/26c8715f32e24d918f15db69518f3ad8

select
    device_id,
    substring_index (blog_url, "/", -1) as user_name
from
    user_submit
  1. 主要是substring_index函数的运用
  2. substring_index(content,'分隔符',索引)
  3. 如:www.wyj.con,substring(url,'.'1)-->www
  4. www.wyj.con,substring(url,'.'2)-->www.wyj
  5. www.wyj.con,substring(url,'.'-1)-->com
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务