select a.PERSONNUM,a.PERSONFULLNAME,a.COMPANYHIREDTM,a.EMPLOYMENTSTATUSDT,a.EMPLOYMENTSTATUSDT
,b.*
from VP_ALLPERSONV42 a, PERSONSTATUSMM b
where a.PERSONID=b.PERSONID
and a.PERSONNUM='1000060728';
查看仅有两条记录,且雇佣状态与账户状态都为终止的数据
select a.PERSONNUM,a.PERSONFULLNAME,a.COMPANYHIREDTM,a.EMPLOYMENTSTATUSDT,a.EMPLOYMENTSTATUS
,b.*
from VP_ALLPERSONV42 a, PERSONSTATUSMM b
where a.PERSONID=b.PERSONID
and a.EMPLOYMENTSTATUS!='Active'
and a.PERSONID IN (
select PERSONID from PERSONSTATUSMM
group by PERSONID
having COUNT (PERSONSTATUSMMID)=2
)