Google
Information Storage and Retrieval: Divide the string into individual Characters (SQL Puzzle 4)

Pages

Tuesday, July 1, 2008

Divide the string into individual Characters (SQL Puzzle 4)

Problem : Divide a given string into individual characters and display these characters into separate rows through a SQL query. For example , the given string is 'Paper', display it as :

Given_String
--------
P
a
p
e
r

The query is :
select substr(&string,rownum,1) given_string
from all_objects
where rownum<=length(&string)

No comments: