ON COMMIT  
 Refresh occurs automatically on the next COMMIT performed at the master table. Can be used with materialized views on single table aggregates and materialized views containing joins only.  可能是不支持group by.
去掉 ON COMMIT就可以了. 

解决方案 »

  1.   

    如果要使用on commit该怎么用呢?
      

  2.   

    奇怪,这样又可以:CREATE MATERIALIZED VIEW log on fact   
      with rowid (store_key, time_key, dollar_sales, unit_sales)  
      including new values;  CREATE MATERIALIZED VIEW sum_sales  
      PARALLEL
      BUILD IMMEDIATE  
      REFRESH FAST ON COMMIT  
      AS  
      SELECT f.store_key, f.time_key,  
             COUNT(*) AS count_grp,  
    SUM(f.dollar_sales) AS sum_dollar_sales,  
            COUNT(f.dollar_sales) AS count_dollar_sales,  
    SUM(f.unit_sales) AS sum_unit_sales,  
            COUNT(f.unit_sales) AS count_unit_sales 
      FROM fact f  
      GROUP BY f.store_key, f.time_key;
      
      

  3.   

    明白了,对于单表,COUNT(*) must always be present.
      

  4.   

    确切讲:是对 Single Table Aggregate Materialized Views