Skip to content

Latest commit

 

History

History
77 lines (55 loc) · 2.17 KB

File metadata and controls

77 lines (55 loc) · 2.17 KB
title JARO_WINKLER_SIMILARITY (Transact-SQL)
description JARO_WINKLER_SIMILARITY calculates a similarity value ranging from 0 (indicating no match) to 1 (indicating full match).
author MikeRayMSFT
ms.author mikeray
ms.reviewer abhtiwar, wiassaf, randolphwest
ms.date 05/19/2025
ms.service sql
ms.subservice t-sql
ms.topic reference
dev_langs
TSQL
monikerRange =azuresqldb-current || =azuresqldb-mi-current || =fabric || >=sql-server-2016
ms.custom
build-2025

JARO_WINKLER_SIMILARITY (Transact-SQL) preview

[!INCLUDE sqlserver2025-asdb-asmi-fabricsqldb]

[!INCLUDE preview]

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

Note

  • JARO_WINKLER_SIMILARITY is currently in preview.
  • SQL Server support for JARO_WINKLER_SIMILARITY introduced in [!INCLUDE sssql25-md].

Syntax

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