Comparisons between values of the same datatype work as you would expect. For
example, a date that occurs later in time is larger than an earlier date, and 0 or any
positive number is larger than any negative number. You can use relational operators
to compare numeric values or date values. For character values, comparisons of
single characters are based on the underlying code pages for the characters. For multicharacter
strings, comparisons are made until the first character that differs
between the two strings appears.
Datatypes | 89
If two character strings of different lengths are compared, Oracle uses two different
types of comparison semantics: blank-padded comparisons and nonpadded comparisons.
For a blank-padded comparison, the shorter string is padded with blanks and
the comparison operates as previously described. For nonpadded comparisons, if
both strings are identical for the length of the shorter string, the shorter string is
identified as smaller. For example, in a blank-padded comparison the string ???A ??? (a
capital A followed by a blank) and the string ???A??? (a capital A by itself) would be seen
as equal, because the second value would be padded with a blank.
Pages:
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211