IN 谓词
IN 谓词将一个值与一组值进行比较。
它可以采用以下两种格式中的一种:
expression [NOT] IN ( subselect )
expression [NOT] IN ( value1, value2, .... )
ValueN 可以是文字值,也可以是输入参数。表达式无法求值为引用类型。
示例:IN 谓词
e.salary IN ( 10000, 15000 )
等价于
( e.salary = 10000 OR e.salary = 15000 )
e.salary IN ( select e1.salary from EmpBean e1 where e1.dept.deptno = 10)
等价于
e.salary = ANY ( select e1.salary from EmpBean e1 where e1.dept.deptno = 10)
e.salary NOT IN ( select e1.salary from EmpBean e1 where e1.dept.deptno = 10)
等价于
e.salary <> ALL ( select e1.salary from EmpBean e1 where e1.dept.deptno = 10)