The Logical AND Operator in Oracle helps to join two or more different Boolean expressions and returns TRUE if all the expressions are true. To understand the concept more clearly follow the table below:
CONDITION_1 | CONDITION_2 | CONDITION_1 AND CONDITION_2 |
True | True | TRUE |
True | False | FALSE |
False | True | FALSE |
False | False | FALSE |
Syntax
Condition1 AND Condition2;
Example
We have a Stu Table as follows:
NOTE: Table Stu has 2 entries with the name Radha. However, Roll_no is different in both entries.
Now to apply AND Operator, let's follow the code as below:
select * from Stu where Name='Radha' AND Roll_no='180';
There are 2 expressions given in the above code:
- We need to find the values where name is Radha.
- With the name Radha, must have 180 as a Roll_no.
It will function as:
Also, we all know that Logical AND returns Values that have both conditions as TRUE
Output
- Log in to post comments