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

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

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

--这道题,有点小坑
	本来有两种解法,但是因为这道题着重考察union all所以那种方法不能用
其实
	用union才与where university = '山东大学',gender = 'male';
	这两个才相同,毕竟union与union all用法不同
	看来是我错怪他了。

select
    device_id,
    gender,
    age,
    gpa
from
    user_profile
where
    university = '山东大学'
union all
select
    device_id,
    gender,
    age,
    gpa
from
    user_profile
where
    gender = 'male';

全部评论

相关推荐

01-30 10:21
中北大学 golang
27届学院本誓死冲击...:技术栈不用搞这么详细,主要还是看实习和项目,毕竟技术栈就那点,你能写这么多,别人也可以写这么多,模版换一下换成上下的,不知道怎么排版可以去看看别人怎么写
投了多少份简历才上岸
点赞 评论 收藏
分享
评论
1
1
分享

创作者周榜

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