IN Operator

Purpose: Tests whether a value matches any value in a list or subquery.

Syntax:

column_name IN (value1, value2, …)

Example

SELECT * FROM employees WHERE department_id IN (10, 20, 30);

Explanation: This retrieves employees who work in departments 10, 20, or 30.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *