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