一尘不染

SQL中IN和ANY运算符之间的区别

sql

INANYSQL中的运算符有什么区别?


阅读 222

收藏
2021-03-17

共1个答案

一尘不染

SQL>
SQL> -- Use the ANY operator in a WHERE clause to compare a value with any of the values in a list.
SQL>

SQL >-您必须在ANY之前放置=,<>,<,>,<=或> =运算符。

SQL> SELECT *
  2  FROM employee
  3  WHERE salary > ANY (2000, 3000, 4000);

对于输入运算符

SQL> -- Use the IN operator in a WHERE clause to compare a value with any of the values in a list.
SQL> SELECT *
  2  FROM employee
  3  WHERE salary IN (2000, 3000, 4000);

但是使用IN运算符时,不能使用=, <>,<,>,<=或> =

2021-03-17