oracle 如何将一个字段内容拆分多行显示

例子:

select regexp_substr('1,2,3,4,5', '[^,]+', 1, level)
from dual
connect by level <= regexp_count('1,2,3,4,5', '[^,]+')

释义:

REGEXP_SUBSTR函数格式如下:

function REGEXP_SUBSTR(String, pattern, position, occurrence, modifier)

__srcstr     :需要进行正则处理的字符串

__pattern    :进行匹配的正则表达式

__position   :起始位置,从第几个字符开始正则表达式匹配(默认为1)

__occurrence :标识第几个匹配组,默认为1

__modifier   :模式('i'不区分大小写进行检索;'c'区分大小写进行检索。默认为'c'。)

扫描二维码关注公众号,回复: 2055429 查看本文章

猜你喜欢

转载自www.cnblogs.com/AaronBear/p/9291026.html