In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 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 role of mysql's or grammar". The content of 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 is the role of mysql's or grammar"?
Mysql or syntax is generally used for queries with multiple conditions, such as "SELECT * FROM WHERE p.`act _ type` = 4 or p.`act _ type` =."
The operating environment of this paper: Windows7 system, mysql8, Dell G3.
What is the use of mysql or?
Example of or statement usage in MySQL
The use of or syntax in 1.mysql, the use of or in mysql syntax. The project encountered a pit, traversing the issue of reward data query error!
$sql = 'SELECT * FROM `vvt_spread_doubleegg_exchange_ award` AS p WHERE p.`act _ type` = 4 or p.`act _ type` = 5 AND p.`user _ id` ='. $user_id
The or syntax in sql is generally used for queries with multiple conditions, and the above syntax query is equivalent to: two sets of data queried by sql.
$sql = 'SELECT * FROM `vvt_spread_doubleegg_exchange_ award` AS p WHERE p.`act _ type` = 4 =' SELECT * FROM `vvt_spread_doubleegg_exchange_ award` AS p WHERE p.`act _ type` = 5 AND p.`user _ id` ='. $user_id
two。 To query the data set act_type = 4 and user_id = 11123 or equal to p.`act _ type` = 5 and user_id = 11123, the conditions on both sides of the or must be added ().
$sql = 'SELECT * FROM `vvt_spread_doubleegg_exchange_ award` AS p WHERE (p.`act _ type` = 4 or p.`act _ type` = 5) AND p.`user _ id` ='. $user_id Thank you for your reading, the above is the content of "what is the role of mysql's or grammar". After the study of this article, I believe you have a deeper understanding of the role of mysql's or grammar, 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.