SQLite: Difference between revisions

From Starfish ETL
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
</source>
</source>
Result: 2
Result: 2
Comparing 2 strings is obviously less than useful, so you would want to do something like:
<source lang="mysql">
<source lang="mysql">
SELECT LEVENSHTEIN( 'Bob', 'Tom' )
SELECT * FROM TABLE WHERE LEVENSHTEIN('Technology Advisors, Inc.', TABLE.NAME) < 5
</source>
</source>
Result: 2

Revision as of 02:47, 31 December 2015

Levenshtein

The SQLite connector has the Levenshtein function! A couple of examples:

SELECT LEVENSHTEIN( 'Microsoft', 'Technology Advisors, Inc.' )

Result: 21

SELECT LEVENSHTEIN( 'Technology Advisors Inc', 'Technology Advisors, Inc.' )

Result: 2

Comparing 2 strings is obviously less than useful, so you would want to do something like:

SELECT * FROM TABLE WHERE LEVENSHTEIN('Technology Advisors, Inc.', TABLE.NAME) < 5