题解 | #查找山东大学或者性别为男生的信息#
查找山东大学或者性别为男生的信息
https://www.nowcoder.com/practice/979b1a5a16d44afaba5191b22152f64a
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'
题目要求不去重,把山东大学和男性都筛选出来再放一起,or只能筛选出符合一种情况的,所以不能使用or,or自带去重,而union与or等价,union all 是不去重
