Dirty Butter Posted March 11, 2017 Share Posted March 11, 2017 Is there any way to search a particular table to see all listings that have one term, but do NOT have another term in a given field? I add any and all keywords I think customers might use in a search to our meta_data, and our search uses that data. It would be great when I think of something I want to add to the terms to find any that I haven't already included that new term. Similarly, is there any way to find listings in the inventory table that have duplicate terms in the meta data? Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 11, 2017 Share Posted March 11, 2017 SELECT * FROM CubeCart_inventory WHERE `name` LIKE "%Book%" AND `name` NOT LIKE "%Volume%"; Selects where Book is somewhere in the column, but Volume is not somewhere in the column. SELECT * FROM CubeCart_inventory WHERE `name` LIKE '%Book%Book%'; Selects where Book is somewhere in the column, and then Book is also somewhere else later in the column. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 11, 2017 Author Share Posted March 11, 2017 Thanks, but the only field I'm interested in is the seo_meta_keywords. Your query seems to find too much. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 11, 2017 Share Posted March 11, 2017 Those were examples. Change `name` to `seo_meta_keywords`, and change Book and Volume to the words you are actually looking for and not looking for. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 11, 2017 Author Share Posted March 11, 2017 Well, I thought I did that, but I'll try again. lol Must have had a typo - worked that time ! YOU ARE A LIFE SAVER!! For my use it works better to use a comma after the term, since I'm trying to be sure it shows in the keywords - not as part of another word. That keeps caterpillars from being found when I'm actually looking for listings with cat that don't have cats in the keywords. 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.