题解 | 查询城市在北京或者职位工资高于100000的job_id和company_id,结果不去重
查询职位城市在北京或者职位工资高于100000的job_id和company_id,结果不去重
https://www.nowcoder.com/practice/5eec83ed40074b7dadfcff16cecfcdcb
select job_id, company_id from job_info where job_city = '北京' union all select job_id, company_id from job_info where salary>100000
集合合并(UNION
操作符)
- 用于合并两个或多个
SELECT
语句的结果集,要求这些SELECT
语句的列数、列数据类型必须一致。 UNION
会自动去除结果集中的重复行,若要保留重复行,需使用UNION ALL
。