Problem: I have a table containing "keywords" associated to a "label". I have to find the label associated to an input string thanks to a query.
Example:
DB (table):
keywords| label | weight
PLOP | ploplabel | 12
PLOP | ploplbl | 8
TOTO | totolabel | 4
... | ... | ...
Input string : "PLOP 123"
Should return: "ploplabel"
The first instinctive query in my mind, for partial keywords reasearch, was:
SELECT label FROM table WHERE keywords LIKE "%inputstring%" ORDER BY weight DESC
But as you may have seen, it is the opposite I would need, something like:
SELECT label FROM table WHERE %keywords% LIKE "inputstring" ORDER BY weight DESC
Is it something we can do in MySQL (innoDB === no fulltext)?