IN operator in SQL

IN Operator –

The IN operator is used to specify a range of conditions, any of which can be matched. IN takes a comma-delimited list of valid values, all enclosed within parentheses.

Syntax of IN –

SELECT column1, column2
FROM table_name
WHERE column1 IN (value1, value2)

Employee Table –

Let’s say you want to select all the employee who are either Manager or Analyst.

SELECT *
FROM emp
WHERE JOB IN ('MANAGER', 'ANALYST');

Rating: 1 out of 5.