Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you really want to define similarity in the exact way that you have formulated in your question, then you would - as you say - have to implement the Levensthein Distance calculation. Either in code calculated on each row retrieved by a DataReader or as a SQL Server function.</p> <p>The problem stated is actually more tricky than it may appear at first sight, because you cannot assume to know what the <em>mutually shared</em> elements between two strings may be. </p> <p>So in addition to Levensthein Distance you probably also want to specify a minimum number of consecutive characters that actually have to match (in order for sufficient similarity to be concluded). </p> <p>In sum: It sounds like an overly complicated and time consuming/slow approach.</p> <p>Interestingly, in SQL Server 2008 you have the DIFFERENCE function which <em>may</em> be used for something like this.</p> <p>It evaluates the phonetic value of two strings and calculates the difference. I'm unsure if you will get it to work properly for multi-word expressions such as movie titles since it doesn't deal well with spaces or numbers and puts too much emphasis on the beginning of the string, but it is still an interesting predicate to be aware of.</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms188753.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms188753.aspx</a></p> <p>If what you are <em>actually</em> trying to describe is some sort of search feature, then you should look into the <a href="http://msdn.microsoft.com/en-us/library/ms142571.aspx" rel="noreferrer">Full Text Search</a> capabilities of SQL Server 2008. It provides built-in <a href="http://msdn.microsoft.com/en-us/library/ms142491.aspx" rel="noreferrer">Thesaurus support</a>, fancy SQL <a href="http://msdn.microsoft.com/en-us/library/ms187787.aspx" rel="noreferrer">predicates</a> and a ranking mechanism for "best matches"</p> <p>EDIT: If you are looking to eliminate duplicates maybe you could look into SSIS <a href="http://msdn.microsoft.com/nb-no/library/ms345128.aspx" rel="noreferrer">Fuzzy Lookup and Fuzzy Group Transformation</a>. I have not tried this myself, but it looks like a promising lead.</p> <p>EDIT2: If you don't want to dig into SSIS and still struggle with the performance of the Levensthein Distance algorithm, you could perhaps try this <a href="http://sites.google.com/site/sqlblindman/fuzzysearchalgorithm" rel="noreferrer">algorithm</a> which appears to be less complex.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload