Your query is my second option if i cant get what i want from jeneesh's query i will go for yours. As Oracle M told i do want to get my output into excel(Download from Oracle Application Express).
I do doubt about you having to go for my solution than for Jeneesh's because both are along similar lines and as demonstrated (probably) produce same output.
If you wish to pass the result of query to APEX, then you just need to return a ref cursor (I am not so sure as I do not have experience about APEX).
Contradicting to what Oracle M has said (probably flawed concepts about pl/sql), you need to minimize PL/SQL and maximize SQL inorder to derive better performance. If all your questions are answered, then please consider closing the Thread by marking it as Answered.