Hi All,
My requirement is to fetch the previous day records.Iam joining three tables hereby.I used the below queries,but the DB2 cost seems to be high.Is there any simpler way to reduce the db2 cost and optimize the query further?
Query:
-----
Iam selecting around ten fields and below is my where condition,
Query:1
--------
Query:2
-------
My requirement is to fetch the previous day records.Iam joining three tables hereby.I used the below queries,but the DB2 cost seems to be high.Is there any simpler way to reduce the db2 cost and optimize the query further?
Query:
-----
Iam selecting around ten fields and below is my where condition,
Query:1
--------
Code:
FROM ARJ00T.ARJAUTH A, ARJ00T.ARJCUST B, ARJ00T.ARJCMNT C WHERE DATE(C.CRTN_TS) = DATE(CURRENT TIMESTAMP - 1 DAYS) AND A.AUTH_RFRNC_NO = B.AUTH_RFRNC_NO AND A.AUTH_RFRNC_NO = C.RFRNC_NO AND A.LOB_C = 'CCDO' AND A.PROD_CODE = 'PPC' AND B.CUST_TP_C = 'IND' WITH UR
-------
Code:
WHERE C.CRTN_TS BETWEEN TIMESTAMP(CURRENT_DATE - 1 DAY) AND TIMESTAMP(CURRENT_DATE - 1 DAY) + 86399 SECONDS
Comment