oracle 分割,号

前端之家收集整理的这篇文章主要介绍了oracle 分割,号前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
select "ID","START_IP","END_IP" from (with temp0 as (select LEVEL lv from dual CONNECT BY LEVEL <= 100)
select ID,substr(t.vals,instr(t.vals,',1,tv.lv) + 1,
instr(t.vals,tv.lv + 1) -(
instr(t.vals,tv.lv) + 1)
) AS start_ip,
substr(t.vals1,instr(t.vals1,
instr(t.vals1,tv.lv + 1) -(
instr(t.vals1,tv.lv) + 1)
) AS end_ip
from (select ID,' || start_ip || ',' AS vals,
length(start_ip || ',') - nvl(length(REPLACE(start_ip,')),0) AS cnt,
',' || end_ip || ',' AS vals1,
length(end_ip || ',') - nvl(length(REPLACE(end_ip,0) AS cnt1

from HOST_WEBSITE_INFO) t join temp0 tv

on tv.lv <= t.cnt order by 1)


注:功能分割start_ip,end_ip

原文链接:https://www.f2er.com/oracle/209280.html

猜你在找的Oracle相关文章