If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

DATED COUNT COUNT_1 COUNT_2
07/02/2008 129
07/03/2008 130 1090
07/04/2008 131 1091 591
07/05/2008 132 1092 592
07/06/2008 133 1093 593
I used below query to get the format but the problem is row_id can increase upto 60 and so will the dated entry.
I need a dynamic query to create such pyramid.

select a.dated,a.count,b.count,c.count FROM TEST_PYRAMID a,
(select dated ,count FROM TEST_PYRAMID where row_id=2) b,
(select dated ,count FROM TEST_PYRAMID where row_id=3) c
where a.dated=b.dated(+)
and b.dated=c.dated(+)
and a.row_id=1
order by 1

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.