IN Operator
The IN operator allows us to specify multiple values in the WHERE clause.
SQL IN syntax
SELECT column_name(s) FROM table_name WHERE column_name IN (value1,value2,...)
Original table (used in the example:)
Persons table:
IN Operator Example
Now, we want to select people with the last names Adams and Carter from the above table:
We can use the following SELECT statement:
SELECT * FROM Persons WHERE LastName IN ('Adams','Carter')
Result set:
PHP Chinese website has a large number of free SQL tutorials, everyone is welcome to learn!
The above is the detailed content of What is the usage of in in sql. For more information, please follow other related articles on the PHP Chinese website!