I don't believe you could do that with a single SQL statement. The best way would be to build intelligence into an application that would look at the search term, determine if it is a plural by looking up it some sort of dictionary, and then use the singular in the form %singularsearchterm%. It gets complicated because this varies from language to language. While, I don't like it, here is a 'quick and dirty' sql statement that will look at the term, if it ends in s, it then drops the s. But don't forget about words like DOS, was, houses, Ross, etc. These would all cause problems using this simplified method (not to mention terms in other languages).
select * from TABLENAME where if(right(SEARCHFIELD,1)='s',left(SEARCHFIELD,lenth(SEARCHFIELD)-1),SEARCHFIELD) like '%SEARCHTEXT%' Hope this sheds some light on it! Craig Ostrander At 06:12 PM 4/10/2002, you wrote: >O.K. dumb question. A bigger string can't be contained in a smaller one. >But how can I make it so someone searching "dogs" can pull up an item that >contains dog? >Thanks, >SW > >On Wednesday 10 April 2002 17:58, you wrote: > > In "MySQL" it says that adding the following to a where clause: > > like "%$somestring%"; > > should select matches that contain $somestring in them anywhere. > > However when I use it I find that if e.g. I have an entry "dog" in the > > database, if I search for "dogs", it doesn't come up. Also if I search for > > "dog house" it doesn't come up. How come? > > Thanks, > > SW > > > > --------------------------------------------------------------------- > > 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 > >------------------------------------------------------- > >--------------------------------------------------------------------- >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 ======================================================= Craig Ostrander Blue Forest Software and Development Inc Database Design Consultants Worldwide MySQL // SAP DB // Oracle // Microsoft SQL Server // Microsoft Access Need help now? [EMAIL PROTECTED] or +1 530 326 5680 ======================================================= spam filter: sql,query --------------------------------------------------------------------- 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