小编Zde*_*ana的帖子

oracle中报告表的数据馈送(汇总vs分组集)

我有一个问题:

select country_region, 
       country_subregion, 
       country_name, 
       calendar_year, 
       calendar_quarter_number, 
       sum(amount_sold) as amount
  from countries co join
       customers cu on co.country_id = cu.country_id join
       sales sa on cu.cust_id = sa.cust_id join
       times ti on sa.time_id = ti.time_id
 where (   co.country_region = 'Americas' 
        or co.country_region = 'Middle East'
       ) 
   and ti.calendar_year between 2000 and 2001
group by grouping sets 
(
    (country_region, country_subregion, country_name, calendar_year, calendar_quarter_number),
    (country_region, country_subregion, country_name, calendar_year),
    (country_region, country_subregion, country_name),
    (country_region, country_subregion, calendar_year, calendar_quarter_number),
    (country_region, country_subregion, calendar_year),
    (country_region, country_subregion),
    (country_region, calendar_year, calendar_quarter_number), …
Run Code Online (Sandbox Code Playgroud)

sql oracle rollup

2
推荐指数
1
解决办法
494
查看次数

为视图创建"代替"触发器时编译错误

我为一个简单的视图创建了一个"而不是"触发器,该视图只对表上的select*和不执行任何操作的触发器(我想最小化问题):

create or replace view tmp(id, nazwa, nip, adres, zalega, punkty) as
select * from klient

create or replace trigger tmp_trg
instead of insert
on tmp
for each row
begin

end;
Run Code Online (Sandbox Code Playgroud)

视图已创建.然后,当我想要声明此触发器时,sql developer返回错误:

错误(8,1):PLS-00103:当遇到以下情况之一时遇到符号"END":如果循环mod为空pragma raise返回选择更新,则使用'一个标识符''双引号开始情况声明退出goto delimited-identifier''绑定变量'<< close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe

oracle plsql

1
推荐指数
1
解决办法
311
查看次数

标签 统计

oracle ×2

plsql ×1

rollup ×1

sql ×1