0
我有一个(甲骨文SQL)查询,搜索的问题:(简体)取决于SELECT结果使用多个EXEC语句
select a.date, (a.counter1 + c.counter)/(c.counter1 - a.counter1) percentdiferent
--daily table is agregated to ocupy less space and be faster when searching for the total counters for a day
from dailytable a
join (
--the nonaggregated table has values for each minute
select trunc(b.date) date, sum(counter1) counter1
from minutetable b
where trunc(b.datea) = a.date
group by trunc(b.date)
) c
on c.date = a.date and c.counter1 <> a.counter1
where percentdiferent > 5
要解决这些问题,我需要执行一个过程:
exec aggregate(tablename, date)
程序经常变化,我有多个表。有没有办法像
with checktables as (
--above code
)
select date
from checktables
group by date
if result > 0
for each result
exec aggregate(tablename,date)
show results
?
可以使用PL/SQL或shell脚本吗? –
只有pl/sql :(,我们这里没有完全访问机器:( – user2586356