且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用T-SQL中两个不同表的值调用Levenshtien函数

更新时间:1970-01-01 07:59:00

目前尚无优化的方法.

您可以采取一些技巧来简化处理过程.例如,您可以使用n-gram在每一侧创建查找表,并且仅比较ngram接近的名称.或者,您可以出于相同的目的使用soundex()或前三个字符.

There may be some hacks that you can do to simplify the processing. For instance, you could create lookup tables on each side using n-grams and only compare names whose ngrams are close. Or, you could use soundex() for the same purpose -- or the first three characters.

但是,如果您需要满足所有可能,那么这是SQL Server中昂贵的n * m操作.

However, if you need to match to all possibilities, then this is an expensive n*m operation in SQL Server.