Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie question on materialized view
Frank <fbortel_at_home.nl> wrote in message news:<3DE9F4D4.3050309_at_home.nl>...
> 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
That's it. It works now. Thanks. Received on Mon Dec 02 2002 - 23:46:30 CST
![]() |
![]() |