Skip to content

Instantly share code, notes, and snippets.

@dannykopping
Created October 8, 2011 16:17
Show Gist options
  • Save dannykopping/1272489 to your computer and use it in GitHub Desktop.
Save dannykopping/1272489 to your computer and use it in GitHub Desktop.
Similarity 2
mysql> SELECT *, jaro_winkler_similarity(`name`, "mr whiskers") AS score
-> FROM CatName
-> ORDER BY score DESC
-> LIMIT 10;
+-------+----------------+----------+
| id | name | score |
+-------+----------------+----------+
| 10105 | Mr. Whiskers | 0.977778 |
| 10108 | Mr. Wiskers | 0.951515 |
| 16204 | Whiskers | 0.909091 |
| 10091 | Mr. Snickers | 0.855219 |
| 10899 | Oprah Whiskers | 0.824459 |
| 10068 | Mr. Mister | 0.82303 |
| 10106 | Mr. Winkie | 0.82303 |
| 16203 | Whiskee | 0.800866 |
| 16205 | Whiskey | 0.800866 |
| 16207 | Whisper | 0.800866 |
+-------+----------------+----------+
10 rows in set (21.16 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment