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';
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';
union自带去重效果,
当需要保留不去重结果时,可以使用union all
。