Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: vowels in oracle
"wajim" <wajim29_at_hotmail.com> a écrit dans le message de news: 1186444143.213413.19310_at_57g2000hsv.googlegroups.com...
| Hi everyone,
| Can somebody give help with a sql statement that retrieves the count
| of vowels in a semtence...
|
| Write a select statement that returns the number of vowels in the
| sentence
| 'Whose line is it anyway'
|
| I have tried something like
|
| select 'Whose line is it anyway'
| count('o', 'e', 'i', 'a', 'y')
| from dual;
|
| it's not working.
|
| Thanks in advance.
|
SQL> with data as (select 'Whose line is it anyway' line from dual)
2 select length(line)-length(translate(line,'xaeiouy','x')) nbVowels
3 from data
4 /
NBVOWELS
10
1 row selected.
Regards
Michel Cadot
Received on Mon Aug 06 2007 - 22:54:25 CDT