in operator in SQL

By: Prof. Fazal Rehman Shamil

in operator in SQL

The IN operator can be used to specify the multiple values in a WHERE clause.

Syntax

SELECT column_names
FROM table_name
WHERE column_name IN (value1, value2, …..);

or

SELECT column_name(s)
FROM table_name
WHERE column_name IN (SELECT STATEMENT);

Use of IN Operator in SQL Query

Example of Query

SELECT * FROM students
WHERE class NOT IN (‘BSCS’, ‘BSIT’);

in operator in sql

Excercise: Download the Database of in operator in SQL and practice it on your XAMPP phpMyAdmin.

Prof. Fazal Rehman Shamil