首页
视频
资源
登录
小可爱
什么时候才能领悟,取之越多失之越多
博主信息
排名
6
文章
6
粉丝
16
评论
8
文章类别
ASP.NET
16篇
JS
1篇
.NET
23篇
英语
4篇
redis
4篇
随笔
30篇
EF
3篇
前端
53篇
.net core
25篇
python
8篇
版本控制
1篇
java
2篇
nginx
2篇
docker
6篇
后端
5篇
更多
mysql
8篇
数据库
15篇
微服务
4篇
移动开发
7篇
架构
6篇
linux
2篇
最新文章
最新评价
{{item.articleTitle}}
{{item.blogName}}
:
{{item.content}}
关于我们
ICP备案 :
渝ICP备18016597号-1
网站信息:
2018-2024
TNBLOG.NET
技术交流:
群号656732739
联系我们:
contact@tnblog.net
欢迎加群
欢迎加群交流技术
原
mysql流程控制函数
2728
人阅读
2022/4/27 19:46
总访问:
880642
评论:
0
收藏:
0
手机
分类:
数据库
**第一种:匹配具体的值** ``` -- case when select username,sex,age,country, case country when '蜀国' then '刘备' when '魏' then '曹操' when '宋' then '赵匡胤' else '其他' end as '领导人' from users ``` **第二种:匹配一个范围条件** ``` -- 显示考试成绩的等级 select username,sub,score, case when score=150 then '满分' when score>=130 then '优秀' when score>=110 then '良好' when score>=90 then '及格' else '不及格' end from score where username = '诸葛亮' ``` 执行结果: ![](https://img.tnblog.net/arcimg/xiuxin/e739ec71bcde45029e7ae5c5cb0cc1f0.png)
欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739
👈{{preArticle.title}}
👉{{nextArticle.title}}
评价
{{titleitem}}
{{titleitem}}
{{item.content}}
{{titleitem}}
{{titleitem}}
{{item.content}}