IN

Allows multiple items to be used within a search, by specifying the required items within parentheses before the keyword IN:

mysql> select * from Students where Surname IN (‘Jones’, ‘Waite’) ;
+----+-------+---------+-----+---------+------+---------+-------+
| id | First | Surname | Age | Town    | PIN  | Study   | Score |
+----+-------+---------+-----+---------+------+---------+-------+
| 3  | Andy  | Jones   | 34  | Croydon | 8198 | Markets | 64    |
| 7  | Terry | Waite   | 58  | Manc    | 2643 | Music   | 59    |
+----+-------+---------+-----+---------+------+---------+-------+
2 rows in set (0.00 sec)

 

Can also be negated using NOT

Leave a Reply