If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > mysql query to find best matching records in two fields

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-14-03, 00:48
br8kwall br8kwall is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
Angry mysql query to find best matching records in two fields

This seems to be a derivation of question that I've seen quite a bit in my quest. Here it is: I'm trying to use the mysql MATCH function to identify the best matching names between two lists stored in two fields in two tables. I think this can be done, but my logic engine is failing me. The FULLTEXT index should be on the NAME fields.

master table
ID1, NAME1
1, mike the great
2, great peter the banana
3, john who shall go unamed
4, jim the stick in the woods

match table
ID2, NAME2
1, peter great
2, mike great
3, john unamed

desired result table
ID3, ID1, NAME2_BEST, SCORE
1, 1, mike great, 0.984
2, 2, peter great, 0.876
3, 3, john unamed, 0.735
4, 4, NULL

Can anyone suggest an approach here?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On