Monday, October 23, 2017

Multi Row Sub Queries

Multi row sub query is a sub query which will return more than one value. In such cases we should include operators like ANY, ALL, IN or NOT IN along with the sub query.

SELECT *
   FROM emp
 WHERE sal > ANY (SELECT sal
                                       FROM emp
                                    WHERE sal BETWEEN 1000 AND 4500);

No comments:

Post a Comment