6 messages in com.mysql.lists.win32Re: Substring Search
FromSent OnAttachments
SGr...@unimin.com28 Mar 2005 10:05 
Armando28 Mar 2005 10:06 
Armando28 Mar 2005 11:09 
SGr...@unimin.com28 Mar 2005 11:34 
Petr Vileta28 Mar 2005 17:07 
Armando29 Mar 2005 07:08 
Subject:Re: Substring Search
From:Armando (diji@shaw.ca)
Date:03/28/2005 11:09:28 AM
List:com.mysql.lists.win32

Thanks Shawn... upon reviewing the basics of the LIKE function (which I was originally trying to use but it wasn't working) I found that my problem was that I had entered my WHERE clause syntax incorrectly. *pause to kick self in butt*

Another question too, do you know of any limitations of this function? I couldn't really find any from a quick search but suspect if you're dealing with large fields in the seacrh criteria it would be more of a performance issue than anything else. Cheers!

SGr@unimin.com wrote:

Armando <diji@shaw.ca> wrote on 03/28/2005 01:06:39 PM:

Hi Everyone,

I've got 2 columns in a table that I need to be able to do a partial string search against. One column is a model number, the other a model name, and I'm having a bit of trouble determining how exactly to do this. (MyISAM tables on MySQL 4.0.17)

For instance say there are a bunch of records that have a model number of 123456789. I need the user to be able to find all those records based on ANY partially matching search criteria (ie; 456). In the same query, I need to be able to look at the model name field and check for a partial match on the same criteria. The nearest I figure is I need to use the instr function in some way. Can someone lend me a hand? Cheers!

Check out the LIKE, and REGEXP(RLIKE) comparators:

http://dev.mysql.com/doc/mysql/en/string-comparison-functions.html