SELECT T1.DESCRIPTION,
T1.NAME,
T1.EXTERNALKEY,
T2.STATECODE
FROM TABLE1 T1, TABLE2 T2, TABLE3 T3
WHERE T1.CLASSID = 7040
AND T2.ID = T3.ID
AND T2.RECEIVERID = T1.ID
AND T1.OWNERID = (SELECT ID
FROM TABLE1
WHERE EXTERNALKEY = 'XXX')
MINUS
SELECT T1.DESCRIPTION,
T1.NAME,
T1.EXTERNALKEY,
T2.STATECODE
FROM TABLE3 T3, TABLE1 T1, TABLE2 T2
WHERE VALUE = 'XXXX' AND T3.ID = T1.ID;
Hi. This is my execution query and it takes very large time. Can anyone changed this to optimized one. Thank u