In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
There is a table student that has the following structure:
Sid sname ssex = 1 Zhang San 1 2 Li Si 1 3 Liu Hong 0 4 Yang Jing 0 5 Li Xing 1
The requirement to write a sql statement shows the following effect:
Sid sname ssex gender = 1 Zhang San 1 male 2 Li Si 1 male 3 Liu Hong 0 female 4 Yang Jing 0 female 5 Li Xing and 1 male
Solution:
Select case when column > 'condition value' then 'value 1' else 'value 2' end from table
That is:
Select *, case when ssex=1 then 'male' else 'female' end as' gender 'from student
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.