STRCMP Function

Description

The STRCMP function compares two strings, string1 and string2, and returns 0 if they are identical, 1 if string1 is greater, or -1 if string1 is smaller. If any of the parameters is NULL, NULL is returned.

Syntax

STRCMP( string1 , string2 )

 

string :

character string

NULL

Example

SELECT STRCMP('abc', 'abc');

 

=======================

                      0

SELECT STRCMP ('acc', 'abc');

 

=======================

                      1

 

--STRCMP works case-insensitively

SELECT STRCMP ('ABC','abc');

 

=======================

                      0