当前位置:网站首页>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
边栏推荐
- 你需要知道的 TCP 三次握手
- [classic example] binary tree recursive structure classic topic collection @ binary tree
- Crazy God said redis notes
- Platformio create libopencm3 + FreeRTOS project
- Luogu deep foundation part 1 Introduction to language Chapter 2 sequential structure programming
- Microservice resource address
- Codeforces Round #804 (Div. 2)
- Postman test report
- Microblogging hot search stock selection strategy
- Postman pre script - global variables and environment variables
猜你喜欢

idea一键导包

What are the advantages of the industry private network over the public network? What specific requirements can be met?

Flody的应用

Embedded development program framework

Vulnerability discovery - vulnerability probe type utilization and repair of web applications

ue5 小知识点 开启lumen的设置

麥斯克電子IPO被終止:曾擬募資8億 河南資產是股東

程序员在互联网行业的地位 | 每日趣闻

RTP GB28181 文件测试工具

Fuzzy -- basic application method of AFL
随机推荐
Delete subsequence < daily question >
Canal synchronizes MySQL data changes to Kafka (CentOS deployment)
Upload nestjs configuration files, configure the use of middleware and pipelines
Postman前置脚本-全局变量和环境变量
Selection sort
L'introduction en bourse de MSK Electronics a pris fin: 800 millions de RMB d'actifs de Henan étaient des actionnaires
也算是學習中的小總結
Bill Gates posted his 18-year-old resume and expected an annual salary of $12000 48 years ago
Fuzzy -- basic application method of AFL
C'est un petit résumé de l'étude.
A little knowledge of CPU, disk and memory
2021RoboCom机器人开发者大赛(初赛)
[05-1, 05-02, 05-03] network protocol
Extension of graph theory
How to estimate the population with samples? (mean, variance, standard deviation)
Digital children < daily question> (Digital DP)
Postman断言
SQL injection vulnerability (MSSQL injection)
[mathematical modeling] differential equation -- sustainable development of fishing industry
Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example