Tema: split
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/05/2013, 04:10
Avatar de zarwar
zarwar
 
Fecha de Ingreso: mayo-2013
Ubicación: Madrid
Mensajes: 77
Antigüedad: 11 años
Puntos: 4
Respuesta: split

Creo que no existe ninguna. La única alternativa, que veo es hacer unPL/SQL.

La verdad, que me pareció interesante el tema de hacer split y encontre algo parecido, para varios registros:

Cita:
SQL> with test as
(
select 1 id, 'joey,anthony,marvin' str from dual union all
select 5 id, 'tony,glenn' str from dual union all
select 8 id, 'john' str from dual
)
select id
, str
, regexp_substr (str, '[^,]+', 1, rn) split
from test
cross
join (select rownum rn
from (select max (length (regexp_replace (str, '[^,]+'))) + 1 mx
from test)
connect by level <= mx)
where regexp_substr (str, '[^,]+', 1, rn) is not null
order by id;

ID STR SPLIT
---------- ------------------- -------------------
1 joey,anthony,marvin joey
1 joey,anthony,marvin marvin
1 joey,anthony,marvin anthony
5 tony,glenn tony
5 tony,glenn glenn
8 john john
Un saludo
__________________
Entra en mi blog sobre base de datos Oracle:
http://mundodb.es