Write a query to display the count of individual characters in a given string. e.g if the given string is "mesopotamia" , the output should be :
m 2
e 1
i 1
s 1
o 2
p 1
t 1
a 2
Solution:
select ind, count(ind)
from
(
select substr(given_string,rownum,1) ind
from
(
select 'mesopotamia' given_string from all_objects
)
where
rownum<=length(given_string)
)
group by ind
return code before grep
-
my 2009 solution return code before grep ( ( ( mycmd echo $? >&3 ) |grep
mytext >&4 ) 3>&1 |(read x;exit $x) )4>&1 my 2025 solution mycmd > >(grep
mytext)
1 week ago
No comments:
Post a Comment