December 2010
Intermediate to advanced
451 pages
11h 16m
English
You have a materialized view that must be refreshed on a scheduled basis to reflect changes made to the underlying table.
First, create the materialized view with a CREATE MATERIALIZED VIEW statement. In this example, a materialized view is created consisting of the department and its total salary.:
CREATE MATERIALIZED VIEW dept_salaries
BUILD IMMEDIATE
AS
SELECT department_id, SUM(salary) total_salary
FROM employees
GROUP BY department_id;
Display the contents of the materialized view:
SELECT *
FROM dept_salaries
ORDER BY department_id;
DEPARTMENT_ID TOTAL_SALARY
------------- ------------
10 6500
20 20200 30 43500 ...Read now
Unlock full access