Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: vowels in oracle

Re: vowels in oracle

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 06 Aug 2007 17:24:48 -0700
Message-ID: <1186446284.723615@bubbleator.drizzle.com>


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.org
Received on Mon Aug 06 2007 - 19:24:48 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US