A relational operator is a mathematical symbol that indicates a certain type of comparison between two values.
The equalities between number can be described as 2+2=4 and between character such as city=’London’.
Suppose you want to see all the salespeople with commission above certain amount, then you would use greater than type of comparison between two values.
The following relational operators are used in oracle:
= Equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
<> Not equal to
These operators have the standard meanings for numeric values.
For character values their definition depends on the conversion format, ASCII or EBCDIC.
Even character values such as ‘1’ which represent numbers do not necessarily equal the number they represent.
You can use relational operators to represent alphabetical order. Ex: ‘a’<’n’ means a precedes n in alphabetical order.
In both ASCII and EBCDIC characters are less than all other characters that they precede in alphabetical order.
In ASCII, all uppercase characters are less than all lowercase characters, so that ‘Z’ < ‘a’ and all numbers are less than all characters, so that ‘1’< ‘Z’.
Both of these are reversed in EBCDIC.
Post a Comment