The IN operator in Oracle checks whether the specified value is included in the specified list. The syntax is: column_name IN (value1, value2, ..., valueN), and returns matching TRUE, otherwise FALSE, which can contain any value. Accepts subqueries and returns NULL for null values. The efficiency is usually higher than NOT IN.
Usage of IN operator in Oracle
IN operator is used to check whether the specified value is included in the specified list middle. The syntax is as follows:
column_name IN (value1, value2, ..., valueN)
where:
column_name
is the column to be checked value1
, value2
, etc. is the list of values Usage:
The IN operator compares the column value to each value in the list. Returns TRUE
if the column value matches any value in the list; otherwise, returns FALSE
.
Example:
<code>SELECT employee_name FROM employees WHERE employee_id IN (1, 2, 3);</code>
This query will return all employee names with employee_id 1, 2, or 3.
Note:
NULL
. The above is the detailed content of How to use in in oracle. For more information, please follow other related articles on the PHP Chinese website!