I have a value in FieldA and another value in FieldB that is stored for comparison purposes by a downstream function. I need to compare if FieldA=FieldB which I do with Mysql:
Select TableA T1
Inner Join TableB T2
On T1.ID=T2.ID
and T1.FIeldA=T2.FIeldB
Set Matched='Y'
However in order to make sure FieldA and FieldB are identical since they come from different sources I need to run a complex Standardization mysql update first e.g.
Update TableA set Field1 Set Field1=Replace(Field1,'Gato','Cat) where Field1 like '%Gato%
(I actually use Regex to make sure the term is whole word anywhere but wanted to keep the question simple, just in case anyone felt compelled to point out where the above might fail).
The issue is I have around 2000 terms that need to be updated so I have to run all 2000 queries on both fields and every time I do the comparison.
So it seemed to me an ideal solution would be Sphinx where I could wordforms or regexp e.g.
Gato>Cat
Perro>Dog
to index the table and then use Sphinx to compare them so that Gato
and Cat
would match.
However I can't figure out a way to structure q sphinxQL query that does a Match
between two fields let alone one that will affect an update as well. Is there any such solution?