Oracle字符串分割成列表

需要将以逗号分割的字符串,拆分出各个元素,然后进行相应的处理,类似对象数据库的功能。

select to_number(regexp_substr('623,323,423','[^,]+',1,rownum,'i')) as staff_id 
from dual connect by 
rownum<=length('623,323,423')-length(replace('623,323,423','',''))+1

返回值为

623

323

423

 

posted @ 2022-03-08 11:02  notis  阅读(775)  评论(0编辑  收藏  举报