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]
Rus,
Use FullText search if you're using a MyISAM table. It will be much faster. See http://dev.mysql.com/doc/mysql/en/Fulltext_Search.html
Mike
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]