Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

extract numbers, print on separate lines

goodluck247Oct 24 2017 — edited Oct 27 2017

Hello,

Suppose I have a varchar column where numbers are stored delimited by a coma, like this:

create table x (

labno number(8),

tests varchar2(30)

);

insert into tests values(1, '03,11,45,77,99,116');

select tests from x;

result:

03,11,45,77,99,116

How would I extract numbers from this string and have have printed on different lines, like this:

03

11

45

77

99

116

Thank you!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2017
Added on Oct 24 2017
14 comments
654 views