SQL IN Operator is very important in phpdatabase operation. This article explains the relevant knowledge.
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,...)
IN Operator Example
Now, we want to select people with the last names Adams and Carter from the above table:
We You can use the following SELECT statement:
SELECT * FROM Persons WHERE LastName IN ('Adams','Carter')
This article provides a relevant explanation of the in operator. For more learning materials, please pay attention to the php Chinese website.
Related recommendations:
Explanation of SQL wildcard related knowledge
Explanation of SQL LIKE operator
The above is the detailed content of How to use the SQL IN operator. For more information, please follow other related articles on the PHP Chinese website!