Here is my table setup:
table_1:
tag int(16) pri
data blob
table_2:
word varchar(20) pri
tag int(16) mul
weight int(16)
Query:
Trying to find (by order of weight) strings that match 'word'.
Example (This works):
SELECT W.tag,W.word,W.weight,N.tag,N.data
FROM table_1 AS N, table_2 AS W
WHERE W.tag like N.tag AND W.word like 'baseball'
ORDER BY W.weight DESC;
What I want to do is be able to find table_1.blob where multiple keywords (table_2.word) are found.
Futher, I want to order the results based upon the combined weight of all the keywords found.
If the keywords searched for are not all matched - then no results should be found.
Example (This returns results, but not what I want):
SELECT W.tag,W.word,W.weight,N.tag,N.data
FROM table_1 AS N, table_2 AS W
WHERE W.tag like N.tag AND (W.word like 'truck' OR W.word like 'ball')
ORDER BY W.weight DESC;
The question is how can I find one tag number that has the cooresponding tags?
-TIA!
table_1:
tag int(16) pri
data blob
table_2:
word varchar(20) pri
tag int(16) mul
weight int(16)
Query:
Trying to find (by order of weight) strings that match 'word'.
Example (This works):
SELECT W.tag,W.word,W.weight,N.tag,N.data
FROM table_1 AS N, table_2 AS W
WHERE W.tag like N.tag AND W.word like 'baseball'
ORDER BY W.weight DESC;
What I want to do is be able to find table_1.blob where multiple keywords (table_2.word) are found.
Futher, I want to order the results based upon the combined weight of all the keywords found.
If the keywords searched for are not all matched - then no results should be found.
Example (This returns results, but not what I want):
SELECT W.tag,W.word,W.weight,N.tag,N.data
FROM table_1 AS N, table_2 AS W
WHERE W.tag like N.tag AND (W.word like 'truck' OR W.word like 'ball')
ORDER BY W.weight DESC;
The question is how can I find one tag number that has the cooresponding tags?
-TIA!