SQL IN Operator : Filter from multiple values or a list - DevDummy

Latest

Guildes | Concepts | Techniques

Tuesday, July 17, 2018

SQL IN Operator : Filter from multiple values or a list




In Operator allows to specify multiple values in where clause


SELECT *
FROM books
WHERE ISBN IN (123456, 456789, ...);

It also smart enough to support nested queries as well,

SELECT *
FROM books
WHERE ISBN IN (SELECT ISBN from registry);


Note : IN operator & JOIN operator behave similarly, when the values of the Joining table are distinct or they are made distinct by defining on inner query. 

.....

No comments:

Post a Comment