STRCMP
Use the @STRCMP function to compare two character columns or literal strings. Enclose literals within quotes.
@STRCMP returns the following:
-
-1if the first string is less than the second. -
0if the strings are equal. -
1if the first string is greater than the second.
Trailing spaces are truncated before comparing the strings.
Syntax
@STRCMP (string1, string2)
string1
The first column or literal string to be compared.
string2
The second column or literal string to be compared.
Example
The following example compares two literal strings and returns 1 because the first string is greater than the second.
@STRCMP ("JOHNSON", "JONES")