What is the use of IN operator in SQL?

The IN operator checks a value within a set of values separated by commas and retrieve the rows from the table which are matching. The IN returns 1 when the search value present within the range otherwise returns 0.

Syntax:

SELECT [column_name... | expression ] FROM [table_name] {WHERE | HAVING | {AND | OR}} value [NOT] IN ({comp_value1, comp_value2[, ...] | subquery});

The IN operator works by comparing one value, usually a column, to a comma-separated list of potential match values held in a set of parentheses. The value to the left of the IN operator is then compared, one at a time, to entire list and an exact match to any one member of the list will cause the argument to evaluate as true.