I am currently selecting the bestmatch in an old-fashioned kind of way:
select t1.x,t2.y,t2.z from t1, t2 where t1.x like concat(t2.y,'%') order by t2.y desc;
x is filled with telephonenumbers whereas y is populated with areacodes of different length, like 702,7025,70255,702555 and z holds the corresponding cityname for y.
Now my question is that I don't want to get ALL the possible matches with the bestmatch as first row, but I only want to get this one row as result. Currently my problem is that I always get each x-number as many times as there are y-entries and that is definitely causing problems.
As always and as you have already expected: this is a rather urgent matter and that's why this is valued at 500 points :-)
Thanks for your help!