I created an application to send mail to users. I\'m using a database where some users have more than one email address assigned.
Name
In Oracle
Here is a mock for provided example:
select 'BusinessXPTO' name, 'mail1@xpto.com;mail2@xpto.com' mail from dual;
Here is how to split the mail column into separate rows
select 'BusinessXPTO' name, regexp_substr('mail_1@xpto.com;mail_2@xpto.com','[^;]+',1, rn) mail
from dual
cross join
(select rownum rn from
(select max(length(regexp_replace('mail_1@xpto.com;mail_2@xpto.com', '[^;]+'))) + 1 mx from dual)
connect by level <= mx )
where regexp_substr ('mail1@xpto.com;mail2@xpto.com', '[^;]+', 1, rn) is not null
order by rn;
Here is the result
NAME MAIL
BusinessXPTO mail_1@xpto.com
BusinessXPTO mail_2@xpto.com