IN
Selects all students that has one of the following last names
გოგია
გაგუა
გოგუა
SELECT *
FROM students
WHERE last_name IN ('გოგია', 'გაგუა', 'გოგუა')
Filtering the result using
IN
with sub-query:
SELECT
    *
FROM
    students
WHERE
    last_name IN(
        SELECT
            last_name
        FROM
            students
        WHERE
            id <= 5
    )
Alternative of the query using
=
operator:
SELECT *
FROM students
WHERE last_name = 'გოგია' 
OR last_name = 'გაგუა'
OR last_name = 'გოგუა'
by Valeri Tandilashvili
4 years ago
MySQL
IN
1
Pro tip: use ```triple backticks around text``` to write in code fences