やあみんな、私はこれに少し困惑しています。これが声明です。過去6ヶ月間に3回以上来院された患者さんを探しています。私はこれが私に簡単なawserを与えるだろうと思った。
SELECT od_ar_demographics.PATIENT_ARPTYPE,
od_ar_demographics.PATIENT_NAME,
od_ar_demographics.MR_NUMBER,
OD_IP1.IP1ADMIT_DATE,
OD_IP1.IP1DISC_DATE,
od_ar_demographics.PATIENT_TYPE
FROM od_ar_demographics INNER JOIN
OD_IP1 ON od_ar_demographics.PATIENT_NUMBER = OD_IP1.IP0NUMBER
where Mr_number in (select MR_number from (SELECT MR_number,
COUNT(MR_number) as LLL
FROM od_ar_demographics INNER JOIN
OD_IP1 ON od_ar_demographics.PATIENT_NUMBER = OD_IP1.IP0NUMBER WHERE IP1admit_date >(getdate()- 180 ) GROUP BY MR_number
HAVING ( COUNT(MR_number) > 3 ))