rtrim(
substr(activityno,
instr(activityno,',', 1, b.row_num)+1,
instr(activityno,',',1,b.row_num+1) - instr(activityno,',',1,b.row_num))
,',') ) activity_no
from ( select ','||'50009,60042'||',' activityno from dual) a,
(select rownum row_num from mkt_record) b
WHERE b.row_num <=((length(a.activityno)- length(replace(a.activityno,',')))/length(','))-1;
========================
Result:
ACTIVITY_NO
------------------
50009
60042
沒有留言:
張貼留言