I am trying to create MQT in DB2 V10 on IBM Z/OS to improve performance on of the SQL. When I try with DATA INITIALLY DEFERRED REFRESH DEFERRED it creates and works. But When I change to DATA INITIALLY DEFERRED REFRESH IMMEDIATE while creating it gives Error at IMMEDIATE.
SET CURRENT SQLID = 'VARVZP';
CREATE TABLE VARVZP.VAC_APPROVAL_MQT
SELECT ESG_CLAIM_NUMBER,MAX(CREATE_TIMESTAMP) CREATE_TIMESTAMP
GROUP BY ESG_CLAIM_NUMBER
DATA INITIALLY DEFERRED REFRESH IMMEDIATE
MAINTAINED BY SYSTEM
DISABLE QUERY OPTIMIZATION
Can you tell me why this error. Refresh Immediate will not accept MAX function?. If so who to rewrite this MQT. Since I need this to be refreshed real time. Is there way to use this instead of trigger.