Difference between revisions of "Relational and Logical Operators"
Line 7: | Line 7: | ||
The relational operators are as follows: | The relational operators are as follows: | ||
− | Not equal to | + | Not equal to |
− | {| width="1189" cellspacing="0" cellpadding="2" border="1" style="border-collapse:collapse; border:1px solid #010101 | + | {| width="1189" cellspacing="0" cellpadding="2" border="1" class="tableintopic" style="border-collapse:collapse; border:1px solid #010101" |
|- align="left" valign="top" | |- align="left" valign="top" | ||
| width="594" bgcolor="#C0C0C0" style="border:1px solid #010101;" | | | width="594" bgcolor="#C0C0C0" style="border:1px solid #010101;" | | ||
Line 25: | Line 25: | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
− | | width="594" style="border:1px solid #010101;" | !=<br> | + | | width="594" style="border:1px solid #010101;" | !=<br> |
| width="594" style="border:1px solid #010101;" | | | width="594" style="border:1px solid #010101;" | | ||
Not equal to | Not equal to | ||
Line 61: | Line 61: | ||
Those relational operators cannot be applied to all data types and in some cases, two values of different types cannot be compared to each other. | Those relational operators cannot be applied to all data types and in some cases, two values of different types cannot be compared to each other. | ||
− | + | <table width="1189" cellspacing="0" cellpadding="2" border="1" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic"> | |
− | + | <tbody><tr align="left" valign="top"> | |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | | + | </td> |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">array</strong></p> | |
− | + | </td> | |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">bool</strong></p> | |
− | + | </td> | |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">number</strong></p> | |
− | + | </td> | |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">question</strong></p> | |
− | + | </td> | |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">range</strong></p> | |
− | + | </td> | |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">string</strong></p> | |
− | + | </td> | |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">datetime</strong></p> | |
− | + | </td> | |
− | + | </tr> | |
− | + | <tr align="left" valign="top"> | |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">array</strong></p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | </tr> | |
− | + | <tr align="left" valign="top"> | |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">bool</strong></p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p> | |
− | | + | </td> |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | </tr> | |
− | + | <tr align="left" valign="top"> | |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">number</strong></p> | |
− | + | </td> | |
− | | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p> | |
− | ==, | + | </td> |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=, >, <, <=, >=</p> | |
− | + | </td> | |
− | = | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p> | |
− | | + | </td> |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | </tr> | |
− | = | + | <tr align="left" valign="top"> |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">question</strong></p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | = | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | ==, | + | </td> |
− | + | </tr> | |
− | + | <tr align="left" valign="top"> | |
− | | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">range</strong></p> |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p> | |
− | == | + | </td> |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | </tr> | |
− | + | <tr align="left" valign="top"> | |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">string</strong></p> | |
− | | + | </td> |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=</p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | | + | </tr> |
− | + | <tr align="left" valign="top"> | |
− | + | <td width="149" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">datetime</strong></p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | = | + | </td> |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> |
− | + | </td> | |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | = | + | </td> |
− | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext"> </p> | |
− | + | </td> | |
− | | + | <td width="149" style="border:1px solid #010101;"><p class="bodytext">==, !=, >, <, <=, >=</p> |
− | + | </td> | |
− | + | </tr> | |
− | | ||
− | |||
− | |||
− | | ||
− | |||
− | |||
− | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ==, | ||
− | |||
− | |||
− | = | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | ||
− | |||
− | |||
− | = | ||
− | |||
− | |||
− | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | = | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | </tbody></table> | |
[[Category:Operators]] | [[Category:Operators]] |
Revision as of 08:24, 5 January 2012
Relational and Logical Operators
Relational refers to the relationships that values can have with one another, and logical refers to the ways in which true and false values can be connected together. Since the relational operators produce true or false results, they are often used in combination with the logical operators.
The relational operators are as follows:
Not equal to
Operator |
Meaning |
== |
Equal to |
!= |
Not equal to |
> |
Greater than |
< |
Less than |
>= |
Greater than or equal to |
<= |
Less than or equal to |
Those relational operators cannot be applied to all data types and in some cases, two values of different types cannot be compared to each other.
<tbody> </tbody>
|
array |
bool |
number |
question |
range |
string |
datetime |
array |
|
|
|
|
==, != |
|
|
bool |
|
==, != |
==, != |
|
|
==, != |
|
number |
|
==, != |
==, !=, >, <, <=, >= |
|
==, != |
|
|
question |
|
|
|
|
|
|
|
range |
==, != |
|
==, != |
|
|
|
|
string |
|
==, != |
==, != |
|
|
==, != |
|
datetime |
|
|
|
|
|
|
==, !=, >, <, <=, >= |