<> 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
This article shares the specific code of js to ac...
cause The reason for writing this blog is that I ...
Table of contents 1. Create a watermark Js file 2...
Today I made a menu button. When you move the mous...
1. Manually create and add my.ini file # CLIENT S...
Table of contents 1. Particle Effects 2. Load the...
MySQL SQL statement performance tuning simple exa...
Table of contents 1. Object 1.1 What is an object...
Table of contents Summarize Sometimes we need to ...
Database version: mysql> select version(); +--...
Table of contents Write docker-compose.yml Run do...
1. Check whether MySQL is installed yum list inst...
Table of contents 1. Install ESXi 2. Set up ESXi ...
Personally, I think the decompressed version is e...
CocosCreator realizes skill CD effect There are s...