Logo 
Search:

SQL Server Articles

Submit Article
Home » Articles » SQL Server » String FunctionsRSS Feeds

DIFFERENCE Function

Posted By: Sarita Patel     Category: SQL Server     Views: 6065

This article explains DIFFERENCE function of sql server with examples.

DIFFERENCE is used to compare 2 character strings and returns difference between the soundex values of specified strings.
Soundex is nothing but same number of characters in the SOUNDEX values. DIFFERENCE can return from 0 to 4. 0 means little or no similarity and 4 means strong similarity or identical values.

Syntax of DIFFERENCE Function :

DIFFERENCE (character_expression1 ,character_expression2)

character_expression1 is a string of type char or varchar. 

character_expression2 is a string of type char or varchar. 

It returns an integer value.



Examples of DIFFERENCE Function :

Example 1 : Use of DIFFERENCE function in select clause

SELECT DIFFERENCE('Syntax','Syntax-Example')

Output
4

Above example compares soundex value of 2 strings 'Syntax' and 'Syntax-Example' and returns difference of it.
  
Share: 

 
 
 

Didn't find what you were looking for? Find more on DIFFERENCE Function Or get search suggestion and latest updates.

Sarita Patel
Sarita Patel author of DIFFERENCE Function is from United States.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!