gpt4 book ai didi

sql - 为什么 SQL Server 的 SOUNDEX 给我不一致的结果?

转载 作者:行者123 更新时间:2023-12-04 13:33:42 24 4
gpt4 key购买 nike

有人可以提供一些有关为什么 SOUNDEX 在某些字符大写与小写时会给出不同结果的见解吗?从我在线阅读的内容来看,SOUNDEX 忽略了大小写,但我得到了不同的结果并且无法理解会导致差异的原因。我不能用像 GUTTHRE 这样的词来模仿这个例子.

Query                                  Result
select SOUNDEX('JESCHKE') J200 <-- 200
select SOUNDEX(LOWER('JESCHKE')) J220
select SOUNDEX('Jeschke') J220
select SOUNDEX('jeschke') J220
select SOUNDEX('JESChKE') J220
select SOUNDEX('JESCHke') J200 <-- for some reason capitalizing 'H' changes the result to 200
select SOUNDEX('jescHke') J200 <-- 200
任何想法为什么值不匹配?

最佳答案

所以wiki状态:

"two letters with the same number separated by 'h' or 'w' are coded asa single number"


所以我认为这适用于当您使用小写的“h”时,因此 S 被编码为 2,所有其他字符都将编码为 2 并按以下方式被忽略:

If two or more letters with the same number are adjacent in theoriginal name (before step 1), only retain the first letter


我怀疑是因为 H 是大写的,所以它重置了这个规则,以便接下来的 k 被编码为另一个 2。

关于sql - 为什么 SQL Server 的 SOUNDEX 给我不一致的结果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63513741/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com