Bill Dandreta wrote:
search for s234 and retrieve all part numbers that contain s234.
Is
SELECT part_number FROM parts WHERE part_number LIKE '%s234%';
the best/fastest way to do it? Will it include part numbers that begin with s234.
Using LIKE in this situation is the best way to go about it. Yes, "LIKE '%s234%'" should return records with part numbers that begin with s234 at the begining or the same string anywhere within the part number.
If you also had a parts description in each record that was rather lengthy, and you wished to query against this column as well, MySQL has a MATCH...AGAINST syntax that can return a 'search engine' style recordset you might be interested in as well:
http://www.mysql.com/doc/F/u/Fulltext_Search.html
If I were you (assuming I have an idea of what it's all about ;-)I would probably keep it simply and use LIKE.
As for returning just a few records at a time use LIMIT:
http://www.mysql.com/doc/S/E/SELECT.html