0
you should check out the analytical and grouping functions provided by orcale 8i or more
i mean the cube and rollup functions ... it contains a perfect solution for your problems ... but they are available only with oracle 8i or more ....
read about it in oracle documentation, it is so helpfull functions for summerizing your SQL code and eliminating complexity and SAVING the query time
Feras