return value of IN predicate ; sql
related to
NOT IN ; sql - Red > Green > Refactor > Red
snippet from reference
>>-+-expression1--+-----+--IN--+-(--fullselect1--)---------+-+->< | '-NOT-' | .-,---------------. | | | | V | | | | +-(------expression2---+--)-+ | | '---expression3-------------' | '-row-value-expression--+-----+--IN--(--fullselect2--)----' '-NOT-'
When the operator is IN, the result of the predicate is:
True if at least one row returned from the fullselect2 is equal to the row-value-expression.
False if the result of fullselect2 is empty or if no row returned from the fullselect2 is equal to the row-value-expression.
Otherwise, unknown (that is, if the comparison of row-value-expression to the row returned from fullselect2 evaluates to unknown because of a null value for at least one row returned from fullselect2 and no row returned from fullselect2 is equal to the row-value-expression).
Examples DEPTNO IN ('D01', 'B01', 'C01'); EMPNO IN(SELECT EMPNO FROM EMPLOYEE WHERE WORKDEPT = 'E11');