Comparison operators

Adaptive Server uses the comparison operators listed in Table 4-5:

Table 4-5: Comparison operators




Equal to


Greater than


Less than


Greater than or equal to


Less than or equal to


Not equal to


Transact-SQL extension – Not equal to


Transact-SQL extension – Not greater than


Transact-SQL extension – Not less than

In comparing character data, < means closer to the beginning of the server’s sort order and > means closer to the end of the sort order. Uppercase and lowercase letters are equal in a case-insensitive sort order. Use sp_helpsort to see the sort order for your Adaptive Server. Trailing blanks are ignored for comparison purposes. So, for example, “Dirk” is the same as “Dirk ”.

In comparing dates, < means earlier and > means later.

Put single or double quotes around all character and datetime data used with a comparison operator:

= "Bennet" 
> "May 22 1947"