解题:不能用where university=‘山东大学’ and gender=‘male’;这样会使重复的去掉 要使用 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';
解题:不能用where university=‘山东大学’ and gender=‘male’;这样会使重复的去掉 要使用 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';