SELECT DISTINCT
Amy polumbo ATIENT_ID, Dr. ISIT_ID, B.N AME, B.I NP_NO, c.a. DMISSION_DATE_TIME, C.D EPT_ADMISSION_TO, Arthur c. harge_type, D.D EPT_NAME
The FROM INP_BILL_DETAIL A, PAT_MASTER_INDEX B, PAT_VISIT C, DEPT_DICT D
WHERE
PATIENT_ID=(a. p. ATIENT_ID)
AND (a. PATIENT_ID=C.P ATIENT_ID) AND (a. VISIT_ID=c. ISIT_ID)
AND a. RCPT_NO IS NULL
AND a. PATIENT_ID NOT IN (SELECT PATIENT_ID FROM PATS_IN_HOSPITAL)
AND SUBSTR (a. ORDERED_BY, 1, 4)='" + ward_code + @ "'
AND D.D EPT_CODE=C.D EPT_ADMISSION_TO
The ORDER BY ADMISSION_DATE_TIME desc
A table data quantity article 3000 w, B 70 w, table 17 C w, D table 100, A great god help me to optimize the
CodePudding user response:
This depends on the execution plan, otherwise, is a guess,CodePudding user response:
CodePudding user response: