Home > Database > Oracle > body text

How to express not equal in oracle

下次还敢
Release: 2024-05-07 16:12:14
Original
447 people have browsed it

There are two ways to express inequality in Oracle: "<>" operator is the most recommended inequality operator. It is used to compare whether two values ​​​​are different and return a Boolean value (TRUE or FALSE). "!=" operator has the same function as the "<>" operator, but is less used.

How to express not equal in oracle

The expression of inequality in Oracle

In Oracle, the inequality operator is represented as "<> ;" or "!=".

Use the "<>" operator

"<>" is the recommended inequality operator in Oracle. It is used to compare two values ​​or expressions and returns a Boolean value (TRUE or FALSE) indicating whether they are not the same.

For example:

<code>SELECT * FROM table_name WHERE column_name <> 'value';</code>
Copy after login

This will return all values ​​in the "table_name" table for which the "column_name" column is not the same as "value".

Using the "!=" operator

The "!=" operator is equivalent to the "<>" operator, but it is less commonly used. It is used to compare two values ​​or expressions and returns a Boolean value indicating whether they are not different.

For example:

<code>SELECT * FROM table_name WHERE column_name != 'value';</code>
Copy after login

This will return all values ​​in the "table_name" table for which the "column_name" column is not the same as "value".

Note:

  • The "<>" and "!=" operators are semantically the same and can be used interchangeably.
  • The not-equal operator is case-sensitive.
  • The NULL value is not equal to any other value, including itself.

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!