Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: vowels in oracle
wajim wrote:
> 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.
It isn't working because it isn't SQL.
SELECT SUM(x)
FROM (
SELECT COUNT(*) AS x
FROM t
WHERE express LIKE '%a%';
UNION ALL
....);
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Mon Aug 06 2007 - 19:24:48 CDT