NOT Operator - ( Oracle Misc )
The NOT operator in Oracle is used to negate a condition or expression. It returns the opposite Boolean value of what it is applied to.
Syntax
The syntax for the NOT operator in Oracle is:
NOT condition
Here, condition
is the expression or condition that we want to negate.
Example
Here is an example of using the NOT operator in an Oracle SQL query:
SELECT *
FROM employees
WHERE NOT job_id = 'IT_PROG';
In this example, the NOT operator is used to select all employees whose job_id is not 'IT_PROG'.
Output
The output of the query will be a list of all employees whose job_id is not 'IT_PROG'.
Explanation
The NOT operator is used in the WHERE clause of the query to negate the condition job_id = 'IT_PROG'
. This means that the query will select all employees whose job_id is not 'IT_PROG'.
Use
The NOT operator is used in SQL queries to negate a condition or expression. This can be useful when we want to select a subset of data that does not meet a certain condition.
Important Points
- The NOT operator negates a condition or expression.
- It returns the opposite Boolean value of what it is applied to.
- The NOT operator is commonly used in the WHERE clause of SQL queries to select a subset of data that does not meet a certain condition.
Summary
In summary, the NOT operator is used in Oracle SQL queries to negate a condition or expression. It returns the opposite Boolean value of what it is applied to, and is commonly used in the WHERE clause to select a subset of data that does not meet a certain condition.