Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie question on materialized view

Re: Newbie question on materialized view

From: inferno2000 <inferno2000_at_my-deja.com>
Date: 2 Dec 2002 21:46:30 -0800
Message-ID: <a9390719.0212022146.244091a0@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US