Tell me more ×
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. It's 100% free, no registration required.

imagine i have this table named "test_table" in the "test_db" in MySQL :

field1         field2

google       http://google.com
apple         http://apple.com
python       http://python.org

now if i search db using this :

SELECT * FROM test_table WHERE field1 = "google"; 

it returned : http://google.com
now i want to search database with field1 and return field2 value where field1 like to search keyword .
for example if i give it "googles" it returned : http://google.com
how i can do this ?
thanks a lot .

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 "google.com" and not something else? Is there a lookup table for spelling mistakes that map to the real strings? – Phil Jan 22 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 at 22:41
Perhaps you mean this?: SELECT field2 FROM test_table WHERE 'googles' LIKE CONCAT( '%', field1, '%' ); – ypercube Jan 22 at 22:46

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.