Compare data
- The ORDER BY clause
- The UNIQUE and DISTINCT keywords
- The UNION keyword
- The BETWEEN operator
For more information about the SELECT statement, see the HCL OneDB™ Guide to SQL: Syntax.
If you define a compare() function, you must also define the greaterthan(), lessthan(), equal(), or other functions that use the compare function.
- The name of the function must be compare(). However, the name is not case sensitive; the compare() function is the same as the Compare() function.
- The function must accept two arguments, each of the data types to be compared.
- The function must return an integer value to indicate the result
of the comparison, as follows:
- <0 to indicate that the first argument is less than (<) the second argument
- 0 to indicate that the two arguments are equal (=)
- >0 to indicate that the first argument is greater than (>) the second argument
The compare() function is the support function for the built-in secondary-access method, B-tree. For more information about the built-in secondary-access method, see Generic B-tree index. For more information about how to customize a secondary-access method for an opaque data type, see Operator classes.