SELECT * FROM (
        SELECT /*+ INDEX(A PK_LINK_HH_STAT) */
               B.ATRD_ID, B.IFSC_ID, B.LINK_ID, A.STAT_DT, SUBSTR(A.STAT_DT, 9, 2) AS STAT_HH, A.SPED 
          FROM TB_LINK_HH_STAT A,
               MV_ATRD_LINK    B
         WHERE 1=1
           AND A.STAT_DT BETWEEN '20190501000000' AND '20190631235959'
           AND A.DAY_TYPE_CD IN ('DTW1', 'DTW2', 'DTW3', 'DTW4', 'DTW5', 'DTW6', 'DTW7')
           AND A.LINK_ID(+) = B.LINK_ID
           --AND B.ATRD_ID IN ('ATRD000100', 'ATRD000101')
) WHERE LINK_ID = 3240281100
    AND STAT_HH = '14'
        
