当前位置:网站首页>MySQL if and ifnull use
MySQL if and ifnull use
2022-07-06 04:54:00 【Data analysis of financial Xiaobai】
SELECT age_range,count(*) FROM
(SELECT IF(IFNULL(age,0)>=25,"25 Years old and over ","25 Under the age of ") as age_range,device_id FROM user_profile) AS user_profile
GROUP BY age_range
SELECT IF(IFNULL(age,0)>=25,"25 Years old and over ","25 Under the age of ") as age_range,count(*) FROM user_profile GROUP BY age_range
SELECT device_id,gender,
CASE
WHEN age<20 then '20 Under the age of '
WHEN age<25 then '20-24 year '
WHEN age>=25 then '25 Years old and over '
else ' other '
END as age_cunt
FROM user_profile
边栏推荐
- 程序员在互联网行业的地位 | 每日趣闻
- Selection sort
- Introduction of several RS485 isolated communication schemes
- It is also a small summary in learning
- [Chongqing Guangdong education] engineering fluid mechanics reference materials of southwestjiaotonguniversity
- Three.js学习-光照和阴影(了解向)
- Ue5 small knowledge freezerendering view rendered objects in the cone
- Sorting out the knowledge points of multicast and broadcasting
- What should the project manager do if there is something wrong with team collaboration?
- [Yu Yue education] reference materials of complex variable function and integral transformation of Northwestern Polytechnic University
猜你喜欢

Flody的应用

Unity screen coordinates ugui coordinates world coordinates conversion between three coordinate systems

Canal synchronizes MySQL data changes to Kafka (CentOS deployment)

RTP gb28181 document testing tool

你需要知道的 TCP 三次握手

Selection of slow motion function

ue5 小知识点 开启lumen的设置

Application of Flody

Codeforces Round #804 (Div. 2)

Visio draws Tai Chi
随机推荐
The web project imported the MySQL driver jar package but failed to load it into the driver
Introduction of several RS485 isolated communication schemes
Word cover underline
A blog to achieve embedded entry
关于es8316的音频爆破音的解决
也算是學習中的小總結
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
2021 RoboCom 世界机器人开发者大赛-本科组(复赛)
项目经理,你会画原型嘛?项目经理需要做产品设计了?
图论的扩展
Weng Kai C language third week 3.1 punch in
Ue5 small knowledge freezerendering view rendered objects in the cone
C'est un petit résumé de l'étude.
Fuzzy -- basic application method of AFL
Postman test report
Scala function advanced
Canal synchronizes MySQL data changes to Kafka (CentOS deployment)
Digital children < daily question> (Digital DP)
【LGR-109】洛谷 5 月月赛 II & Windy Round 6
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower