-- 按姓名分取最大值
select * from jobs a where exists(select 1 from jobs b where a.job_desc=b.job_desc and b.min_lvl<a.min_lvl)
-----------------------------------------------------------------------------------------------------------------
-- 按姓名分取最小值
select * from jobs a where exists(select 1 from jobs b where a.job_desc=b.job_desc and b.min_lvl>a.min_lvl)
-------------------------------------------------------------------------------------------------------------------
--求一表中重复的值
select * from jobs a where exists(select 1 from jobs b where a.job_id>b.job_id and a.job_desc=b.job_desc and a.min_lvl=b.min_lvl)
----------------------------------------------------------------------------------------------------------------------
--查找两表中不同的内容
select * from jobs where not exists(select 1 from jobes where jobes.job_desc=jobs.job_desc)