Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 1.86 KB

jaro-winkler-similarity-transact-sql.md

File metadata and controls

69 lines (49 loc) · 1.86 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic dev_langs monikerRange
JARO_WINKLER_SIMILARITY (Transact-SQL)
JARO_WINKLER_SIMILARITY calculates a similarity value ranging from 0 (indicating no match) to 1 (indicating full match).
MikeRayMSFT
mikeray
abhtiwar, wiassaf, randolphwest
01/21/2025
sql
t-sql
reference
TSQL
=azuresqldb-current || =fabric

JARO_WINKLER_SIMILARITY (Transact-SQL)

[!INCLUDE asdb-fabricsqldb]

[!INCLUDE preview]

Calculates a similarity value ranging from 0 (indicating no match) to 1 (indicating full match).

JARO_WINKLER_SIMILARITY (
    character_expression,
    character_expression
)  

Arguments

character_expression

An alphanumeric expression of character data. character_expression can be a constant, variable, or column. The character expression cannot be of type varchar(max) or nvarchar(max).

Return value

real

Remarks

This function implements the Jaro-Winkler edit distance algorithm and calculates the similarity value.

Examples

The following example compares two words and returns the JARO_WINKLER_SIMILARITY value as a column, named Similarity.

SELECT 'Colour' AS WordUK, 
       'Color' AS WordUS, 
       JARO_WINKLER_SIMILARITY('Colour', 'Color') AS Similarity;

Returns:

WordUK WordUS Similarity
------ ------ -------------
Colour Color  0.9666666

For additional examples, see Example JARO_WINKLER_SIMILARITY.

Related content