Used alongside a WHERE clause as a shorthand for multiple OR conditions.
So instead of:
SELECT * FROM users
WHERE country = 'USA' OR country = 'United Kingdom' OR
country = 'Russia' OR country = 'Australia';
You can use:
SELECT * FROM users
WHERE country IN ('USA', 'United Kingdom', 'Russia',
'Australia');
(IN) operator in sql like "OR" operator
For example:
Select * From employees
Where department_id "IN" (60,90);
SELECT first_name, country
FROM Customers
WHERE country IN ('USA', 'UK');
Code Example |
---|
Sql :: t_sql contains |
Sql :: SQL CASE With ELSE in SQL |
Sql :: minus in sql |
Sql :: alter or change postgresql sequence counter |
Sql :: sql datitime to date |
Sql :: snowflake select from stage |
Sql :: how to get initials in sql |
Sql :: add not null constraint sql server |
Sql :: mysql auto increment column |
Sql :: oracle concat datetime |
Sql :: sql query to check if column contains alphabets |
Sql :: Get all index postgres |
Sql :: multiple replace value mssql |
Sql :: declare value in sql |
Sql :: SQL Subtraction Operator |
Sql :: t-sql check if data exists |
Sql :: sql practice |
Sql :: mysql find_in_set join |
Sql :: mysql if statement |
Sql :: error 1054 mysql |
Sql :: create function postgresql |
Sql :: mysql expression is not in group by clause |
Sql :: sql unique constraint |
Sql :: phone number regex sql |
Sql :: sql union operator |
Sql :: bigquery current time |
Sql :: using distinct and count together in sql |
Sql :: what is relational database |
Sql :: set column width in sqlplus |
Sql :: date in mysql |