Hi,
In 10.2 when a query is run with GROUP BY it does not order the output by the grouped columns. In
earlier versions the output was always sorted by the the grouped columns even though there was no
ORDER BY clause present.
[Oracle Version --Oracle 10.2.0.1.0]
In order to get an ordered output,decided to add ORCDER BY clause explicitly.
But gave ORA-00904: invalid column name error for following query.
select max(acc_seq) from tbrc1wb
group by br_cd,rc_base,fr_bk_ind,bdl_acc
union
select max(acc_seq) from tbrc1mb
group by br_cd,rc_base,fr_bk_ind,bdl_acc
order by br_cd,rc_base,fr_bk_ind,bdl_acc
Please suggest how to add ORDER BY clause in the above query.