The following is my select statement. How can I make this more effecient? My temp datafile is growing out of control and was curious how I can get this query to run better. Thanks, Wendi
SELECT DISTINCT A.PAT_EXT_ID||'|'||A.PAT_FIRST_NAME||'|'|| A.PAT_LAST_NAME||'|'||B.RX_MED_NAME||'|'||B.RX_SIZE||'|'||B.RX_AMT||'|'||(ascii(B.RX_TYPE))||'|'||B.RX_ROUTE||'|'||B.D_RX||'|'||B.D_DC||'|'||C.PROBLEM_NAME||'|'||C.D_PROBLEM||'|'||C.PROBLEM_CODE1||'|'||C.PROBLEM_TYPE
FROM MRPA99 A, MRRX99 B, MRPL99 C, MRSC99 D
WHERE A.PTID(+)=B.PTID AND B.PTID(+)=C.PTID AND C.PTID(+)=D.PTID and A.PAT_EXT_ID = '69910.0';
SELECT DISTINCT A.PAT_EXT_ID||'|'||A.PAT_FIRST_NAME||'|'|| A.PAT_LAST_NAME||'|'||B.RX_MED_NAME||'|'||B.RX_SIZE||'|'||B.RX_AMT||'|'||(ascii(B.RX_TYPE))||'|'||B.RX_ROUTE||'|'||B.D_RX||'|'||B.D_DC||'|'||C.PROBLEM_NAME||'|'||C.D_PROBLEM||'|'||C.PROBLEM_CODE1||'|'||C.PROBLEM_TYPE
FROM MRPA99 A, MRRX99 B, MRPL99 C, MRSC99 D
WHERE A.PTID(+)=B.PTID AND B.PTID(+)=C.PTID AND C.PTID(+)=D.PTID and A.PAT_EXT_ID = '69910.0';