How to convert rows returned by a query into columns in oracle?
- by Piyush Lohana
I have to display the results of the below query as columns.
select to_char(sysdate + 1 - rownum,'MON-YYYY') as d
from all_objects
where trunc(sysdate + 1 - rownum,'MM') = trunc(to_date(:from_date,'MON-YYYY'),'MM')
minus
select to_char(sysdate + 1 - rownum,'MON-YYYY') as d
from all_objects
where trunc(sysdate + 1 - rownum,'MM') trunc(to_date(':to_date','MON-YYYY'),'MM')
Please help me in figuring that out.