> Hi Rob.  Give this a shot.
> 
> SELECT * FROM YourTable WHERE title LIKE '% Man' Or
> title LIKE '% Men'
> 
> J. Ptak

That comes very close to working for everything. Only
thing is the word can be at the beginning of the
title, the middle of the title, or the end.

WHERE (title LIKE '% man') or (title LIKE '% men') or
(title LIKE 'man %') or (title LIKE 'men %') or
(title LIKE '% man %') or (title LIKE '% men %')

That seems to work correctly. Thanks for the clue. I
was hoping for something that would be quicker but if
it works I'll use it. If you come across some way to
use RLIKE or something similiar......

Thanks again,

Robert

--- Gate2Savings <[EMAIL PROTECTED]>
wrote:
> Hi Rob.  Give this a shot.
> 
> SELECT * FROM YourTable WHERE title LIKE '% Man' Or
> title LIKE '% Men'
> 
> J. Ptak
> 
> 
> "Rob Gambit" <[EMAIL PROTECTED]> wrote in message
> news:<albosu$1dpj$[EMAIL PROTECTED]>...
> > Hello MySQL mailing list.
> > 
> > I am having trouble creating a SQL statement for
> > searching.
> > 
> > Suppose I have a field named title that contains
> one
> > of these
> > I am a Man
> > I am a Woman
> > We are Men
> > We are Women
> > 
> > Now I am trying to search that field using
> keywords,
> > for example, I want to return any that contain the
> > word "man" or "men" but not "woman" or "women"
> > 
> > WHERE (title LIKE 'man') OR (title LIKE 'men')
> > 
> > but that doesn't return anything. I tried
> > 
> > WHERE (title LIKE '%man%') or (title like '%men%')
> > 
> > but that returns everything. I tried using the _
> > instead of % but the word may or may not be at the
> end
> > or beginning of the line.
> > 
> > Can someone point me in the right direction (or
> tell
> > me how to do it)
> > 
> > Thanks.  Sorry for the newbie question.
> > 
> > Robert
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Finance - Get real-time stock quotes
> http://finance.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list
> archive)
> > 
> > To request this thread, e-mail
> <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail 
> >
>
<[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try:
> http://lists.mysql.com/php/unsubscribe.php
> > 
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to