我的where exists
条款不起作用。我错过了什么微不足道的事情?
select * from patient as p
where exists
(
select p.patientid, count(*) from tblclaims as c
inner join patient as p on p.patientid=c.patientid
and p.admissiondate = c.admissiondate
and p.dischargedate = c.dischargedate
group by p.patientid
having count(*)>500
)
如您在查询中看到的那样,患者和 tblclaims 通过三字段复合键连接在一起。