following table defines available relational operators:
Operator | Term | Description |
== | equal | Returns true if both expressions are equal. |
>= | greater than or equal | Returns true if expression1 is greater than or equal to expression2. |
<= | less than or equal | Returns true if expression1 is less than or equal to expression2. |
> | greater than | Returns true if expression1 is greater than expression2. |
< | less than | Returns true if expression1 is less than expression2. |
!= | not equal | Returns true if expression1 differs from (not equal to) expression2. |
&& | and | Returns true if both expression1 and expression2 are true. |
|| | or | Returns true if expression1 or expression2 or both are true. |
! | not | A unary operator. Negates the expression. Returns true if the expression is false, and false if the expression is true. |
like | like | Returns true if expression1 is like expression2. This can use * as a wildcard for zero or more characters and ? as wildcard for one character. |
The following are examples using relational operators and their return values:
Evaluated Expression | Return Value |
'abcdef' like 'abc*' | TRUE: the * is equal to any string of characters. |
'abcdef' like 'abc?' | FALSE: the ? is equivalent to one character. |
9 != 10 | TRUE: these values are not equal to one another. |
(10 > 9) && (11 <= 11) | TRUE: both expressions are true. |
!('abc' = = 'def') || (8 > 9) | TRUE: the first expression returns true. |
Best Regards,
Hossein Karimi
No comments:
Post a Comment