<> OperatorFunction: Indicates not equal to. Note: It has the same function as the “!=” operator, but “<>” is less readable. ### To query non-Han users, the following two statements have the same effect. > SELECT * FROM user WHERE nation != "汉族"; > SELECT * FROM user WHERE nation <> "Han"; <=> OperatorFunction: Safety is equal to Note: It integrates the functions of the "=" operator and the IS keyword, and can determine both NULL and basic data types. But in comparison, “<=>” is less readable. From the following SQL statement, we can see that the "=" operator and the IS keyword cannot be used interchangeably. The "=" operator can only determine basic data types, and the IS keyword can only determine NULL. The "<=>" operator can be used in relatively few scenarios. It can basically only be used for search conditions. There is no need to determine whether a search condition is NULL or a basic data type. ### Query users who have not filled in their gender. The following statements have the same effect> SELECT * FROM user WHERE sex IS NULL; > SELECT * FROM user WHERE sex <=> NULL; ### Query male users. The following statements have the same effect> SELECT * FROM user WHERE sex = "男"; > SELECT * FROM user WHERE sex <=> "male"; This is the end of this article about the MySQL <> and <=> operators. For more related MySQL <> and <=> content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: HTML table markup tutorial (1): Creating a table
>>: vue+el-upload realizes dynamic upload of multiple files
Introduction In a production environment, in orde...
1. Top-level usage 1. Install cnpm npm i -g cnpm ...
MySQL official website download address: https://...
Table of contents 1. Prototype chain inheritance ...
Table of contents 1. Project Prospects 2. Knowled...
If the developer uses Dockerfile to build the ima...
Each of these 16 sites is worth reading carefully,...
1. To optimize the query, try to avoid full table...
Table of contents Overview Subqueries Subquery Cl...
Writing method 1: update sas_order_supply_month_p...
This article shares the specific code of JavaScri...
mysqladmin is an official mysql client program th...
Basic Concepts Current read and snapshot read In ...
IE8 new feature Web Slices (Web Slices) Microsoft...
At first I thought it was a speed issue, so I late...