Try the following sintax:

Select * from fruits

where

(fruits.color like '%Green%' or
fruits.color like '%Apple%')

or 
(fruits.type like '%Green%' or
fruits.type like  '%Apple%');

Regards,

Laercio.

-----Original Message-----
From: Rui Monteiro [mailto:[EMAIL PROTECTED] 
Sent: quarta-feira, 22 de setembro de 2004 04:27
To: [EMAIL PROTECTED]
Subject: Like - Problem

Hello there,

 

I was wondering how I could make a specific type of search when the string
has more than one word.

 

Ex.---------------------------------------------

 

String = "Green Apple"

 

Select * from fruits

where

 

(fruits.color like '%Green Apple%'

or fruits.type like '%Green Apple%')

 

------------------------------------------------

 

What I thought was breaking the string in 2 words and compares each word
with the fields. The problem is that I can't control how many fields should
be compared.

 

Also don't know how to compare each word. The following syntax doesn't work:

 

-----------------------------------------------

 

Select * from fruits

where

 

(fruits.color like in ('%Green%', '%Apple%')

or fruits.type like in ('%Green%', '%Apple%')

 

-----------------------------------------------

 

Any ideas would be very thankful.

 

Cheer's

 

Rui Monteiro



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

Reply via email to