相关疑难解决方法(0)

使用T-SQL进行模糊匹配

我有一个表的人与personaldata等.有很多专栏,但这里曾经感兴趣的是:addressindex,lastname以及firstnameaddressindex公寓门口钻一个独特的地址.因此,如果我"喜欢下面"两个人和lastname一个人firstnames相同,他们很可能是重复的.

我需要一种方法来列出这些重复项.

tabledata:

personid     1
firstname    "Carl"
lastname     "Anderson"
addressindex 1

personid     2
firstname    "Carl Peter"
lastname     "Anderson"
addressindex 1
Run Code Online (Sandbox Code Playgroud)

我知道如果我要在所有列上完全匹配,但是我需要模糊匹配来完成这个技巧(来自上面的例子),结果如下:

Row     personid      addressindex     lastname     firstname
1       2             1                Anderson     Carl Peter
2       1             1                Anderson     Carl
.....
Run Code Online (Sandbox Code Playgroud)

关于如何以一种好的方式解决这个问题的任何提示?

t-sql sql-server fuzzy-search

66
推荐指数
5
解决办法
14万
查看次数

人们常用名别名/昵称的数据库

我参与了一个将搜索名称列表的SQL/.NET项目.我正在寻找一种方法来返回类似人名的一些结果.如果搜索"Tom",结果将包括Thom,Thomas等.这是文件还是Web服务并不重要.示例设计:

Table "Names" has Name and NameID
Table "Nicknames" has Nickname, NicknameID and NameID
Run Code Online (Sandbox Code Playgroud)

示例输出:

You searched for "John Smith"
You show results Jon Smith, Jonathan Smith, Johnny Smith, ...
Run Code Online (Sandbox Code Playgroud)

是否存在适合此类任务的任何数据库(公共或付费)来填充昵称和名称之间的关系?

database search

38
推荐指数
4
解决办法
3万
查看次数

标签 统计

database ×1

fuzzy-search ×1

search ×1

sql-server ×1

t-sql ×1