我有一个特定的查询,一旦该查询创建了一个显示每天的特定总和数量的表,我每天都必须执行该查询,而不是我想在物化查询中执行它,以免每天都创建这里是查询:
create table close_qty
as
select item_code,item_conc_code,tran_bran_code,sum(tran_qty) bal_qty
from tranhist a,itemmast b
where a.tran_item_code = b.item_code
group by item_code,item_conc_code,tran_bran_code
我正在尝试创建物化视图,但出现以下错误
ERROR at line 1:
ORA-00901: invalid CREATE command
这是我的查询
CREATE MATERIALIZED VIEW vwCloseQty
AS
select item_code,item_conc_code,tran_bran_code,sum(tran_qty) bal_qty
from tranhist a,itemmast b
where a.tran_item_code = b.item_code
group by item_code,item_conc_code,tran_bran_code
如果它会影响性能以及如何解决错误,请提出建议