Home > Database > Oracle > body text

How to express not equal in Oracle

下次还敢
Release: 2024-05-07 14:03:14
Original
468 people have browsed it

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>
Copy after login

参数:

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

结果:

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

示例:

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

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

注意:

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

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!