TecTao Posted December 16, 2012 Share Posted December 16, 2012 Is there a way to do a wildcard search for a word or phrase in all fields of a table such as select * from `aTable` where `(all fields)` like % this word or phrase% rather than elect * from `aTable` where `fields1` like % this word or phrase% OR `fields2` like % this word or phrase% OR `fields3` like % this word or phrase% Basically a search through the entire table for a specific word or phrase? Quote Link to comment Share on other sites More sharing options...
Jessica Posted December 17, 2012 Share Posted December 17, 2012 No. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 17, 2012 Share Posted December 17, 2012 I've seen people concatenate the columns together and use that on the left-hand side of a LIKE '%%' comparison. Quote Link to comment Share on other sites More sharing options...
fenway Posted December 22, 2012 Share Posted December 22, 2012 Or you could use a proper full-text indexing product, like sphinx. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.