Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Imagine I have this table named test_table in the test_db in MySQL:

field1     field2  

Now if I search the database using this:

SELECT * FROM test_table WHERE field1 = "google"; 

It will return :
Now I want to search the database with field1 and return field2 value where field1 like to search keyword.
For example if I give it googles it should return :
How can I do this?

share|improve this question
You're asking for something like a soundex query, but unfortunately it's not. What you're asking for is beyond the reach of this site. How would I know that "googles" is "" and not something else? Is there a lookup table for spelling mistakes that map to the real strings? – Phil Jan 22 '13 at 22:40
or perhaps a FTS that uses a stemmer of some sort (Lucene?) ... or a natural language stemmer to preparse the query. – swasheck Jan 22 '13 at 22:41
Perhaps you mean this?: SELECT field2 FROM test_table WHERE 'googles' LIKE CONCAT( '%', field1, '%' ); – ypercubeᵀᴹ Jan 22 '13 at 22:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.