Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create timeline via SQL

user12272004May 7 2010 — edited May 7 2010
Hello together,

I want to create a timeline in SQL to generate a barchart in a client application. The request from the client application should only restrict the start- and the enddate.
As result for '2010-01-01' to '2010-01-05' the following is expected:

DATE | COUNT
-------------
2010-01-01 | 1
2010-01-02 | 4
2010-01-03 | 1
2010-01-04 | 0
2010-01-05 | 10

The given datatable contains 16 rows, 1 for each count and none with '2010-01-04'.

The idea is getting a row for each date between '2010-01-01' and '2010-01-05' and get the count via a subselect.

I hope I described my wish so everyone can understand what I want! ;)
So, thanks for your additional ideas/input!

regards,
Tobias

ps: sorry, I forgot we are using Oracle 10.2.1.0
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2010
Added on May 7 2010
3 comments
1,462 views