我对 Oracle SQL 编程非常陌生。可以在使用参数的 Oracle 存储过程中使用以下 sql(请参阅我想在哪里使用参数)?如果是这样,怎么做?
Select Tuo.*
From OFFVISITS Tuo
inner join (
select mr1.pat_id, count(mr1.contact_date)
from OFFVISITS mr1
inner join (
select pat_id,count(contact_date)
from OFFVISITS
Where Death_Date Is Null
A nd Rpt_Grp = <parameter 1>
AND MONTHS_BETWEEN(SYSDATE,CONTACT_DATE) <= <parameter 2>
group by pat_id
having count(contact_date) >= <parameter 3>) mr2 on mr2.pat_id = mr1.pat_id
Where Mr1.Death_Date Is Null
And Mr1.Rpt_Grp = <parameter 4>
AND MONTHS_BETWEEN(SYSDATE,mr1.CONTACT_DATE) <= <parameter 5>
and mr1.ref_bill_code in (select DIAGNOSIS_CODE from DIAG_CODES)
group by mr1.pat_id
Having Count(Mr1.Contact_Date) >= 1) Mr On Mr.Pat_Id = Tuo.Pat_Id
AND TUO.RPT_GRP = <parameter 6>
order by tuo.pat_id';
谢谢。