题解 | #查找山东大学或者性别为男生的信息#

查找山东大学或者性别为男生的信息

http://www.nowcoder.com/practice/979b1a5a16d44afaba5191b22152f64a

分析思路:
1.限制条件两个 山东大学 或 男性
where university = '山东大学'
where gender = 'male';
2.要求先输出山东大学,再输出男性,且结果不去重,那么这里就使用union all 来连接两次查询

解题思路:
select device_id,gender,age,gpa
from user_profile
# where university = '山东大学'&nbs***bsp;gender = 'male';
# 没看到题目要求先输出山东大学再输出男性用户
where university = '山东大学'
union all
select device_id,gender,age,gpa
from user_profile
where gender = 'male';


全部评论

相关推荐

星辰再现:裁员给校招生腾地方
点赞 评论 收藏
分享
06-23 17:45
门头沟学院 Java
里面的项目啥的真的有用吗? 这些人是割韭菜吗?
HellowordX:很简单,如果你有自己稳定的学习路线和获取知识的方式就没必要,如果你啥都不懂的小白或者里边有你感兴趣的知识,我觉得挺值,我也经常为知识付费,因为时间精力有限,很多东西我不可能自己重复造轮子
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务