Oracle: Logical OR Operator

The Logical OR Operator in Oracle helps to join Boolean expressions and returns TRUE if minimum one condition returns TRUE.

Syntax

Condition1 OR Condition2;

Follow the Table to understand the concept better:

CONDITION_1CONDITION_2CONDITION_1 OR CONDITION_2
TrueTrueTRUE
True FalseTRUE
FalseTrueTRUE
False FalseFALSE

Example

We have a Stu Table as follows:

Oracle: Logical AND Operator

NOTE: Table Stu has 2 entries with the name Radha. However, Roll_no is different in both entries.

Follow the Code for OR Operator on Stu table:

select * from Stu where Name='Radha' OR Roll_no='180';

1) We need to find the values where name is Radha.
2) And also the values with 180 as a Roll_no.

It will function as:

Oracle: Logical AND Operator

Also, we all know that Logical OR Operator that have have either condition TRUE.

Output

logical OR Operator

NOTE: All the values that returns even a single TRUE is displayed in Output.