In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail what are the differences between or and and in mysql. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Differences: 1, there is a difference in its own meaning, or means "or", and means "and"; 2, there is a difference in function, and must meet all the conditions, while or can meet one condition.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
When we query the data, we will use conditions to filter the data, achieve the filtering effect, filter the unwanted data, and get what we need.
The most basic is the WHERE clause query: SELECT * FROM cs_user WHERE id = 10
In this way, we can query the data with id = 10. This is a single multiple choice question like only one conditional filter.
So in a table:
For me, as long as the age (age) is between 18 and 20 (inclusive). So with the above WHERE clause, a single condition, it is difficult to get the effect we want, at this time, and and or come, English is even beginner students all understand the meaning of and and or.
AND (and) and
OR (or) or
It is not difficult to understand it, but it is very troublesome when it is used in practice and the logic may not be clear at the beginning of learning. Let's take a look:
AND:SELECT * FROM cs_user WHERE age > = 18 AND age = 18 or age = 18 should also satisfy the data of age = 18, display it, and then get the age
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
Find Findm: = bson.M {"create_time": bson.M {"$gte": start, "$lte": end,}, "accoun"
© 2024 shulou.com SLNews company. All rights reserved.