I'm having a similar problem. This works fine in 9i (accessing 8i through a database link) but not in 8i.
code:
select
a.row_owner,
max(b.full_name),
count(1) total_rows,
max(c.period_total) "6 MONTH UPDATES",
max(d.period_total) "12 MONTH UPDATES"
from
accounts a,
row_owner_table b,
(select count(owner_id) period_total, owner_id from accounts where last_update > ( sysdate - 180) group by owner_id ) c,
(select count(prd_ow_i) period_total, owner_id from accounts where last_update > ( sysdate - 360) group by owner_id ) d
where
b.id = a.row_owner and
d.owner_id (+) = a.owner_id and
c.owner_id (+) = a.owner_id
group by a.owner_id order by count(1) desc;
I managed to rewrite it using decode()/greater()/sum() but now I have to do another query where I need to use 2 group by's in a subquery.
(see also http://saloon.javaranch.com/cgi-bin/...&f=55&t=000417)
Anybody got some other suggestions on this type of query?
Simon