Home >Database >Mysql Tutorial >How to write not equal in mysql

How to write not equal in mysql

下次还敢
下次还敢Original
2024-04-26 05:30:18543browse

Not equal to the query condition in MySQL: use the != operator to indicate not equal. For example: SELECT * FROM table_name WHERE column_name != value;

How to write not equal in mysql

In MySQL, it means not equal to

Query condition:

In MySQL, use != to indicate not equal.

Example:

<code class="sql">SELECT * FROM table_name WHERE column_name != value;</code>

Detailed description:

!= Operator compares two expressions formula and returns a Boolean value (TRUE or FALSE). If the two expressions are not the same, TRUE is returned; otherwise, FALSE is returned.

Other inequality operators:

In addition to the != operator, there are some other inequality operators:

  • <>: Same as !=, indicating not equal.
  • NOT: Negation operator. When used with a comparison operator, its result is inverted (for example, NOT = means equal).

Note: The

  • != and <> operators have the same priority.
  • In some cases, you can use <> instead of != to improve code readability.

The above is the detailed content of How to write not equal in mysql. 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