Home > Database > Mysql Tutorial > body text

How to write not equal in mysql

下次还敢
Release: 2024-04-26 05:30:18
Original
438 people have browsed it

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

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!

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!