SQL IN Operator – SQL TUTORIAL | Software Testing Material
SQL IN Operator:
The SQL IN operator allows you to test if an expression matches any value in a list of values. It is specified with in a WHERE clause.
Syntax:
SELECT column_name(s) FROM table_name WHERE column_name IN (value_1,value_2,...value_n);
Example:
SELECT * FROM SCOREBOARD WHERE Runs IN (100,90);
In the below image, you could see two SELECT queries. First SELECT query returns the complete records from the table SCOREBOARD. Second SELECT query returns only the values based on the condition (i.e., Runs with in 90 to 100)
In the next tutorial, we will see How To Use BETWEEN OPERATOR in SQL
Check out the complete SQL Tutorial by clicking on below link: