<> 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
The main contents of this article are as follows:...
Vue version, copy it to the file and use it <t...
Table of contents Introduction Child Process Crea...
Generally speaking, it is unlikely that you will ...
This article aims to use the clearest structure t...
The so-called container actually creates a readab...
HTML <dl> Tag #Definition and Usage The <...
The various HTML documents of the website are con...
1: What is openssl? What is its function? What is...
This article mainly introduces how some content i...
Note When developing an article display list inte...
1. Command Introduction nl (Number of Lines) adds...
background The amount of new data in the business...
need Configuring DingTalk alarms in Zabbix is s...
Anti-shake: Prevent repeated clicks from triggeri...