--Author: Venkata Potluri
--Date: May 05, 2015

  SELECT /*+ full(PR_RL_ID) parallel(PR_RL_ID,5) */ M.MEM_NUM,
         M.NAME,
         A.TXN_ID,
         A.ROW_ID,
         A.CREATED,
         A.CREATED_BY,
         A.LAST_UPD,
         A.LAST_UPD_BY,
         A.CONFLICT_ID,
         A.MODIFICATION_NUM,
         ATR_DFN.DISPLAY_NAME,
         A.ACCRUALED_VALUE,
         A.USED_VALUE,
         A.EXPIRATION_DT,
         A.RET_EFF_DT,
         PR.NAME PROMOTION_NAME,
         PR_RL.NAME RULE,
         PR_RL_ID.NAME ACTION,
         A.PROMO_ID,
         PR_RL_ID.PROMO_RULE_ID,
         PT_BLK.NAME PT_BLK_NAME,
         A.POINT_BLK_ID,
         A.PROMO_BUCKET_ID,
         A.QUALIFYING_FLG,
         A.STATUS_CD,
         A.PRTNR_PT_DEBT_QTY,
         A.COMMENTS
    FROM SIEBEL.S_LOY_ACRL_ITM A
         INNER JOIN SIEBEL.S_LOY_MEMBER M ON A.MEMBER_ID = M.ROW_ID
         INNER JOIN SIEBEL.S_LOY_ACTCRTR PR_RL_ID
            ON A.ACTION_ID = PR_RL_ID.ROW_ID
         INNER JOIN SIEBEL.S_LOY_PROMO_RL PR_RL
            ON PR_RL_ID.PROMO_RULE_ID = PR_RL.ROW_ID
         INNER JOIN SIEBEL.S_LOY_PROMO PR ON A.PROMO_ID = PR.ROW_ID
         INNER JOIN SIEBEL.S_LOY_ATTRDEFN ATR_DFN
            ON A.ATTRIB_DEFN_ID = ATR_DFN.ROW_ID
         INNER JOIN SIEBEL.S_LOY_PT_BLCK PT_BLK
            ON A.POINT_BLK_ID = PT_BLK.ROW_ID
   WHERE M.MEM_NUM IN ('3900466',
                       '3900245',
                       '5000273',
                       '100000235',
                       '65049095',
                       '200782374',
                       '200782503',
                       '55',
                       '900000000255',
                       '65646825',
                       '97939590',
                       '100364703',
                       '30207096',
                       '52920976',
                       '21453',
                       '4001',
                       '7410082',
                       '64386055',
                       '10430092',
                       '33500095',
                       '23051066',
                       '38038221',
                       '200782676',
                       '200004151',
                       '64386055',
                       '138622',
                       '100000305',
                       '100364342',
                       '200001222',
                       '100000235',
                       '21865815',
                       '100365226',
                       '70991',
                       '60826916',
                       '100375133',
                       '1674632',
                       '80146684',
                       '200782702',
                       '50943686',
                       '46855270')
ORDER BY MEM_NUM, A.TXN_ID DESC;