Alternate to group by clause
396862Feb 12 2009 — edited Feb 17 2009Hi
I am using Oracle 8i and one of my queries is getting the data from multiple sources through a dblink from other databases (customer need cannot avoid dblinks).
The query is using the group by clause to get the count based on specific columns and when i am not using the group by the query is pretty fast.
select count(id), col1,col2,col3
from source1@dblink1,
source2@dblink1,
source3@dblink1,
source4@dblink1,
source5@dblink1
where
...
group by col1,col2,col3
Please suggest the use of other Oracle features that we can use (pl/sql table or looping in pl/sql instead of using group by ) as the amount of data is large and it has to go through several iterations and accordingly update my local db with the counts returned.
An example will be quite helpful.
Thanks in Advance.