All Type Coding

Search Here

IN operator in sql server.

IN Operator
The IN conditional operator is really a set membership test operator. That is  allow you to specify multiple values in a WHERE clause.

Syntax:
            SELECT column_name
                  FROM table_name
                  WHERE column_name IN (value1,value2,...);

Below is a selection from the "Product" table:

















Now we'll select data from product table with IN operator.














Using the IN operator Only that three records fetch out of five records from database table 
So IN opertaor is specify multiple values in a WHERE clause. we can use IN operator with other operator like NOT operator.













Using with NOT operator. IN operator fetch only that records which is not specify inside the IN operator like the above . 

No comments :

Post a Comment