In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following mainly brings you the use of or sentences in MySQL. I hope these words can bring you practical use, which is also the main purpose of this article when I edit the use of or sentences in MySQL. All right, don't talk too much nonsense, let's just read the following.
$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; $sql =' 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
For the above about the use of or statements in MySQL, we do not think it is very helpful. If you need to know more, please continue to follow our industry information. I'm sure you'll like it.
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.