SQL IN query Command and statementsSQL IN statement can be used with where clause to list a set of matching records of a table. We can use SQL in query with NOT combination also to filter out some records. This is our table
We will apply in command to display records of class Four and Fifth only.
SELECT * FROM `student` WHERE class IN ('Four','fifth')
Here above the sql in query returns the records of class Four and Fifth only. We can apply NOT IN sql query also like below to remove some records in display.
SELECT * FROM `student` WHERE class not IN ('Four','fifth')
Select * from student where id in ( select * from student_sports)Here inside student_sports we have only one column storing the student id.
Number of User Comments : 1