" and is used to compare whether two values ​​are equal and return TRUE or FALSE. For example, SELECT product_id, product_name FROM products WHERE product_price <> 10 returns products whose price is not equal to 10."/> " and is used to compare whether two values ​​are equal and return TRUE or FALSE. For example, SELECT product_id, product_name FROM products WHERE product_price <> 10 returns products whose price is not equal to 10.">

Home >Database >Oracle >How to express not equal in Oracle

How to express not equal in Oracle

下次还敢
下次还敢Original
2024-05-07 14:03:14553browse

Oracle 中的不等于操作符用“<>”表示,用于比较两个值是否不相等,返回 TRUE 或 FALSE。例如,SELECT product_id, product_name FROM products WHERE product_price <> 10返回价格不等于 10 的产品。

How to express not equal in Oracle

Oracle 中的不等于操作符

在 Oracle 中,不等于操作符表示两个值不相等。它使用符号“<>”表示。

语法:

<code>expr1 <> expr2</code>

参数:

  • expr1:要比较的第一个表达式。
  • expr2:要比较的第二个表达式。

结果:

如果 expr1 不等于 expr2,则返回 TRUE;否则返回 FALSE。

示例:

<code class="sql">SELECT product_id, product_name
FROM products
WHERE product_price <> 10;</code>

此查询返回产品表中产品价格不等于 10 的产品。

注意:

  • 不等于操作符与“!=”操作符相同,但使用“<>”更为常见。
  • 也可以使用 NOT EQUAL 关键字来表示不等于,例如:
<code class="sql">SELECT product_id, product_name
FROM products
WHERE NOT product_price = 10;</code>

The above is the detailed content of How to express not equal in Oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn