Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie question on materialized view
Jonathan Lewis wrote:
> But it is a single table aggregate view.
>
<snip>
You need count(*), count(f2), sum(f2)...
Connected to:
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
With the Partitioning option
JServer Release 8.1.7.4.0 - Production
SQL> create table t_test (f1 number, f2 number);
Table created.
SQL> create materialized view log on t_test
2 with rowid (f1, f2)
3 including new values;
Materialized view log created.
SQL> create materialized view mv_t_test
2 build immediate refresh fast on commit
3 enable query rewrite
4 as select
5 f1, count(*), count(f2), sum(f2)
6 from t_test
7 group by f1;
Materialized view created.
Grtz, Frank Received on Sun Dec 01 2002 - 05:39:00 CST