关于soundex

[复制链接]
查看11 | 回复1 | 2012-5-15 15:24:11 | 显示全部楼层 |阅读模式
哪位大哥能讲一下soundex的功能和用途
多谢!!!
回复

使用道具 举报

千问 | 2012-5-15 15:24:11 | 显示全部楼层
Purpose
Returns a character string containing the phonetic representation of char. This function allows you to compare words that are spelled differently, but sound alike in English.

The phonetic representation is defined in The Art of Computer Programming, Volume 3: Sorting and Searching, by Donald E. Knuth, as follows:


Retain the first letter of the string and remove all other occurrences of the following letters: a, e, h, i, o, u, w, y.
Assign numbers to the remaining letters (after the first) as follows:
b, f, p, v = 1
c, g, j, k, q, s, x, z = 2
d, t = 3
l = 4
m, n = 5
r = 6
If two or more letters with the same assigned number are adjacent, remove all but the first.
Return the first four bytes padded with 0.


Example
SELECT ename
FROM emp
WHERE SOUNDEX(ename)
= SOUNDEX('SMYTHE');
ENAME
----------
SMITH
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行