2019-03-11
阅读量:
721
两条sql语句能不能组合成一条
问题描述:
select count(1) from student where age>20;
select count(1) from student where age<=20;
类似这两个查询,能不能合成一条查询?
解决方法:
select sum(age>20) age1, sum(age<=20) age2 from student;
0.0000
0
2
关注作者
收藏
评论(0)
发表评论
暂无数据
推荐帖子
0条评论
0条评论
0条评论

