Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

how to get alternative strings in list of strings.

$
0
0
Hi experts,

how to get alternative strings in list of strings.

eg

'country1, italy, country2, india, country3, paris, country4, scottland, country5, rome'

from the above list i need to fetch all the countries and their names separately.

sample output
==============
country1
country2
country3
country4
country5


italy
india
paris
scottland
rome

i am trying the above one in the below fashion

SELECT SUBSTR
('country1, italy, country2, india, country3, paris, country4, scottland, country5, rome',
1,
INSTR
('country1, italy, country2, india, country3, paris, country4, scottland, country5, rome',
',',
1,
1
)
- 1
)
FROM DUAL

can you please any one help me

Viewing all articles
Browse latest Browse all 13329

Trending Articles