目录
环境
文档用途
详细信息
环境
系统平台:Microsoft windows (64-bit) 2012
版本:5.6.5
文档用途
对Mysql函数substring_index(str,delim,count)进行兼容
详细信息
mysql函数功能:按照关键字截取字符串,substring_index(被截取字段,关键字,关键字出现的次数)
HGDB函数:
create or replace function substring_index(text,text,int) returns text as $$ declare a text; b text :=""; var int; begin for var in 1..$3 loop a=split_part($1,$2,var); b=b || $2 || a; end loop; return substring(b from 2 for length(b)); end $$ language plpgsql |
例子:
MySQL:
mysql> select substring_index("fhafjkdalsfhiad,fjadsoj;f,adsf,dsfa","s",3); +--------------------------------------------------------------+ | substring_index("fhafjkdalsfhiad,fjadsoj;f,adsf,dsfa","s",3) | +--------------------------------------------------------------+ | fhafjkdalsfhiad,fjadsoj;f,ad | +--------------------------------------------------------------+ 1 row in set (0.00 sec) |
HGDB:
highGo=# select substring_index("fhafjkdalsfhiad,fjadsoj;f,adsf,dsfa","s",3); substring_index ------------------------------ fhafjkdalsfhiad,fjadsoj;f,ad (1 行记录) |
更多详细信息请登录【瀚高技术支持平台】查看https://support.highgo.com/#/index/docContent/9a21c30204850ea3
--结束END--
本文标题: 对MySQL函数substring_index(str,delim,count)的兼容
本文链接: https://www.lsjlt.com/news/8340.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0