to select all names where there are 3 words in it for
instance. If there were such a function as words(string) which
returned the number of words in a string then the simple select
syntax would be:
select * from names where words(name) = 3
Of course in MySql there is no such function (that I am
in a string then the simple select
syntax would be:
select * from names where words(name) = 3
Of course in MySql there is no such function (that I am aware of) -
so any ideas how I can achieve this result.
Easy (although not all that fast) way:
select * from names where name regexp
PROTECTED]
Sent: Thursday, January 09, 2003 1:03 AM
Subject: Re: Select * from names where words(name) = 3
Thanks Dan,
It never occured to me to use regular expressions. (I'm still new to
Mysql)
You have opened up a whole new world to me :-)
The tables I am working with only have a few
returned the
number of words in a string then the simple select syntax would be:
select * from names where words(name) = 3
Of course in MySql there is no such function (that I am aware of) - so any
ideas how I can achieve this result.
Thanking You
Clyde Engalnd
PS: one obvious solution is to add