gpt4 book ai didi

sql - 分割字符串并获取最后一个元素

转载 作者:行者123 更新时间:2023-12-01 19:09:39 35 4
gpt4 key购买 nike

我有一个包含以下值的表:

Articles/Search/ArtMID/2681/ArticleID/2218/Diet.aspx
OurStory/MeettheFoodieandtheMD.aspx
TheFood/OurMenu.aspx

我想要这个

Diet.aspx
MeettheFoodieandtheMD.aspx
OurMenu.aspx

我该怎么做?

最佳答案

在 SQL 中执行此操作的方法:

SELECT SUBSTRING( string , LEN(string) -  CHARINDEX('/',REVERSE(string)) + 2  , LEN(string)  ) FROM SAMPLE;

JSFiddle在这里http://sqlfiddle.com/#!3/41ead/11

关于sql - 分割字符串并获取最后一个元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14412898/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com