MySQL IN

MySQL IN

MySQL IN syntax and examples.

MySQL IN syntax

SELECT * FROM table_name WHERE col IN (val1,val2);

Table books

ID NAME PRICE
1 book1 20.0
2 book2 25.0
3 book3 15.0

IN example

SELECT * FROM books WHERE id IN (1,3);

Query Result

ID NAME PRICE
1 book1 20.0
3 book3 15.0