In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what is the meaning of the equal sign in mysql". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn what the equal sign in mysql means.
In mysql, "=" means equality and is a comparison operator, which is mainly used to compare whether the operands on both sides are equal, return 1 if equal, and return 0 if not equal. Note that "=" cannot be used to determine a null NULL, so if one or two operands are NULL, the result of the comparison operation is NULL.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
In mysql, "=" means equality and is a comparison operator.
The = operator is used to compare whether the operands on both sides are equal, returning 1 if equal and 0 if not. The specific grammar rules are as follows:
If one or two operands are NULL, the result of the comparison operation is NULL. (reason: NULL cannot be used for = comparison. )
If both operands are strings, compare them according to strings.
If both operands are integers, they are compared according to integers.
If one Operand is a string and the other is a number, MySQL can automatically convert the string to a number.
Example: use = to determine equality
Mysql > SELECT 1, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, NULL=null +-+ | 1: 0 | 2: 2 | 2: 2 | 0: 0: 0: 0 | 2: 2: 2 | (1: 3) = 2: 2 | NULL=null | + -+ | 0 | 1 | 1 | 0 | 1 | 1 | NULL | +- +-+-+ 1 row in set (0.01 sec)
Analysis of the running results:
The return values of'2' 2 and'2' = 2 are the same, both 1, because MySQL automatically converts the character'2' to the number 2 when making the judgment.
'baked characters'is the same character comparison, so the return value is 1.
The result of expression 1-3 and 2-2 is 4, so the result is equal, and the return value is 1.
Since = cannot be used to determine a null NULL, the return value of NULL=null is NULL.
Thank you for your reading, the above is the content of "what is the equal sign in mysql". After the study of this article, I believe you have a deeper understanding of what the equal sign in mysql means, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.