In this article let’s discuss about using Materialized views in Oracle.
What is Materialized View?
Materialized view is similar to a view but the actual table data will exist in the Database. These views will be refreshed automatically when the master tables are updated.
CREATE MATERIALIZED VIEW mv_employee
REFRESH COMPLETE START WITH SYSDATE
ASSELECT EMP_ID,EMP_NAME,DEPT_ID,MAX(SALARY)FROM EMPLOYEES@orcl GROUPBY EMP_ID,EMP_NAME,DEPT_ID;
REFRESH COMPLETE START WITH SYSDATE
ASSELECT EMP_ID,EMP_NAME,DEPT_ID,MAX(SALARY)FROM EMPLOYEES@orcl GROUPBY EMP_ID,EMP_NAME,DEPT_ID;