Piyush Lohana
Piyush Lohana

Reputation: 43

How to convert rows returned by a query into columns in oracle?

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.

Upvotes: 1

Views: 3406

Answers (1)

Related Questions