Searching two database columns for similarities
Posted on 2005-04-21
Quite simply, I'm looking for a way to compare a particular column in Table 1 with a particular column in Table 2.
No, I'm not crazy: here's a better way of explaining it:
Table 1 contains knowledgebase articles. The column I want to use as my search parameters for searching Table 2 is called 'Description'.
Table 2 contains a list of 'resolutions', or solutions to a problem.
My problem is that it's easy to use LIKE, SOUNDEX or DIFFERENCE on any one term, but if the description is a long string, how can I query Table 2 for the closest matching solution?
For example, a typical case might be:
TABLE 1 DESCRIPTION:
Today, my printer faield. In fact, it failed twice. I've checked the toner and power cable and both are OK. Can you help?
TABLE 2's RECORDS:
Printers need regular topping up with Toner. If yours has run out, contact IT Support to get some.
Has your printer stopped working? Check the printer cables are plugged in!
If your mouse sticks, give it a clean. Sometimes dirt causes it to function improperly.
Can we use each word individually in TABLE 1 DESCRIPTION to search through all the descriptions in TABLE 2, ranking by the most relevant first?