久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 T-SQL 查找近似重復的數據庫記錄?

Finding approximately duplicate database records using T-SQL?(使用 T-SQL 查找近似重復的數據庫記錄?)
本文介紹了使用 T-SQL 查找近似重復的數據庫記錄?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

大家好.我有一個包含相當多行的 MSSQL 2008 數據庫.到目前為止,在將新行插入表中之前,存儲過程會檢查該記錄是否已存在于數據庫中(通過檢查標記為 Title 的列).這個檢查是精確的,如果要插入的記錄略有不同,它會插入它而不是更新現有行(這是一個近似匹配).我想做的是在插入之前以某種方式檢測表中的近似重復.所以要插入的新記錄:

Hey all. I have a MSSQL 2008 database with a fair number of rows. As of now, before new rows are inserted into the table, the stored procedure checks to see if that record already exists in the database (by checking a column labeled Title). This check is exact, and if the to-be-inserted record is slightly different, it will insert it instead of updating the existing row (which is an approximate match). What I would like to do is somehow detect approximate duplications in the table before inserting. So a new record that is to be inserted:

The quick brown fox jumps over the lazy dog

大致匹配:

Quick brown fox jumps over the lazy dog

如果該記錄已經存在于表中.我已經看到(并用于其他情況)在 T-SQL 中實現的 Levenshtein Distance 算法,但我不確定這是否適用于我的情況,因為執行算法需要一對輸入字符串.社區成員如何處理此類事情?謝謝.

if this record exists in the table already. I've seen (and used for other situations) the Levenshtein Distance algorithm implemented in T-SQL, but I'm not sure if this could be applied in my case because a pair of input strings are required to execute the algorithm. How are members of the community handing things of this sort? Thanks.

推薦答案

全文搜索是您最好的選擇.由于需要大量的計算,在任何非平凡大小的文本語料庫上使用 Levenshtein 很快就會出現問題.對于基于字符的差異而不是基于單詞的差異,更常見的是使用 LD/SOUNDEX 等.假設單詞至少拼寫正確,FTS 會更合適.我還可以想象一種使用 FTS 來識別可能的匹配候選者的兩層方法,并在過濾后的集合上執行更細粒度的匹配.如果你真的想去城里,那么搜索文本的最佳結構之一是 Trie,但這在表中實現起來很棘手,并且作為內存中的數據結構效果更好.基于單詞的 n-gram 解決方案也可能值得研究.

Full-Text Search is your best bet here. Using Levenshtein on any non-trivial sized corpus of text soon becomes problematic due to the computational grunt required. It's more common to use LD/SOUNDEX etc for character based discrepancies rather than word based discrepancies. Assuming words are at minimum correctly spelled, FTS would be a better fit. I can also imagine a two-tiered approach using FTS to identify likely match candidates, with finer grained matching performed over the filtered set. If you really want to go to town, then one of the best performing structures for searching text is the Trie, but this is tricky to implement in tables, and works better as an in-memory data-structure. A word based n-gram solution might also be worth investigating.

這篇關于使用 T-SQL 查找近似重復的數據庫記錄?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Converting Every Child Tags in to a Single Column with multiple Delimiters -SQL Server (3)(將每個子標記轉換為具有多個分隔符的單列-SQL Server (3))
How can I create a view from more than one table?(如何從多個表創建視圖?)
Create calculated value based on calculated value inside previous row(根據前一行內的計算值創建計算值)
How do I stack the first two columns of a table into a single column, but also pair third column with the first column only?(如何將表格的前兩列堆疊成一列,但也僅將第三列與第一列配對?) - IT屋-程序員軟件開發技
Recursive t-sql query(遞歸 t-sql 查詢)
Convert Month Name to Date / Month Number (Combinations of Questions amp; Answers)(將月份名稱轉換為日期/月份編號(問題和答案的組合))
主站蜘蛛池模板: 一区二区三区在线播放 | 狠狠色综合久久丁香婷婷 | 日本成人三级电影 | 久久久久亚洲 | 国产精品夜夜春夜夜爽久久电影 | www.玖玖玖 | 综合九九 | 亚洲精品日韩在线 | 午夜资源 | 日韩精品一区二区三区视频播放 | 国产精品自产av一区二区三区 | 综合久久一区 | 日韩在线第一 | 亚洲美女在线一区 | 在线中文字幕视频 | av免费观看网站 | av免费网址| 日韩成人免费视频 | 91精品国产综合久久久久久丝袜 | www.亚洲精品 | 国产精品成人69xxx免费视频 | 日韩欧美视频在线 | 国产一区视频在线 | 国产精品久久久久久久久久 | 欧美日韩一| av大全在线 | 亚洲精品一区二区 | 99视频免费播放 | 大象一区 | 91 在线| 午夜久久av| 亚洲欧美日韩国产 | 亚洲国产精品日本 | 最新日韩欧美 | 密室大逃脱第六季大神版在线观看 | 欧美在线a | 欧美成人免费在线 | 国产精品美女久久久久久久网站 | 国产高潮好爽受不了了夜夜做 | 国产日韩欧美中文字幕 | 国产亚洲一区二区精品 |