Yeah, I was sort of heading that route. But I would also like to determine a count of the numbers in a string too. Certainly the query is doable, but it's unwieldy.

What I have so far:
SELECT fld, @FLDLEN:=char_length(fld) fld_len, @FLDLEN-char_length(replace(fld,'o',''))[EMAIL PROTECTED](replace(fld,'a',''))[EMAIL PROTECTED](replace(fld,'e',''))[EMAIL PROTECTED](replace(fld,'i',''))[EMAIL PROTECTED](replace(fld,'u','')) fld_vow_cnt FROM table

It works, but it's not the most readable query.
Thanks

----- Original Message ----- From: "Barry Newton" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Thursday, May 31, 2007 1:58 PM
Subject: Re: Determining number of vowels in a string



I'd rather do it in a sql statement rather than using a scripting language.

I'm thinking you might be able to do one select, accumulating 5 siubstring counts (a,e,i,o,u) into 5 variables, and then sum the counts? I'll leave the testing to you. . .:-)


Barry Newton



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to