Comparisons of variable-length character columns (VARCHAR and CLOB) and variable-length binary columns (BIN, VARBIN, and BLOB) use exact matches on the operands, without removing trailing spaces or binary zeroes.
Example comparison conditions for variable-length character column, in which ' ' is one space surrounded by single quotes:
Condition
WHERE COL1 = ' '
is true if the column data is exactly one space
Condition
WHERE COL1 > ' '
excludes column data of one space
Condition
WHERE COL1 <= ' '
includes column data of one space
If a difference exists in the common lengths of the two fields, a comparison result is
returned.
If matched on the common length, but either field has a variable length (VARCHAR, CLOB) and one of the operands is longer, a result is returned by comparing the extra bytes to a space byte.
If matched on the common length, but either field is a fixed length (CHAR) and one of the operands is longer, return a result by comparing the extra bytes to a space byte.
Constant literals in the comparison SQL cannot exceed 255 bytes and must be in the format 'AA'