In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the use of mysql if else multi-condition examples, the article is very detailed, has a certain reference value, interested friends must read it!
1. Write a update statement to increase commodity prices. The specific rules are as follows
Within 99 yuan, the price will be increased by 20%.
2. Between 100 and 999 yuan, the price will be increased by 10%
Between 1000 and 1999, the price will be increased by 5%.
4. Other price increases by 2%
Update goods set price = (case when price between 0 and 99 then price * 1.2 when price between 100 and 999 then price * 1.1 when price between 1000 and 1999 then price * 1.05 when price > 1999 then price * 1.02 end); select * from goods
2. Write a select statement to achieve the following effect
Student number, name, score grade-1 Zhang San 86 good 2 Li Si 98 excellent 3 Wang Wu 72 pass 4 that six 69 pass 5 Primary one 56 fail
The rules are as follows:
1, > = 90: excellent
2, > = 80: good
3, > = 60: pass
4. = 90 then 'excellent' when score > = 80 and score
< 90 then '良好' when score >= 60 and score < 80 then 'pass' when score < 60 then 'fail' end) as level from scores; or above is all the contents of this article entitled "examples of Multi-conditional use of if else in mysql". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.