I think there is a bug with auto group by suggest feature. I have a query which looks like this (goes against dba_hist_* views)
select trunc(dt) as dt, x.sql_id ,sum(execd) num_execs ,sum(piod) tot_piod ,sum(liod) tot_liod ,sum(cpud) tot_cpu ,sum(elad) tot_ela ,round(sum(elad)/greatest(sum(execd),1),3) avg_ela ,round((sum(liod)/greatest(sum(execd),1))) avg_lio from x, y where x.sql_id = y.sqlid group by x.sql_id, trunc(dt)
The group-by-suggest feature thinks trunc(dt) in the group by clause, is not needed and suggests that I remove it, but if you remove that, you get ora-979. Bug?
Message was edited by: rjamya, corrected typo