By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,197 Members | 974 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,197 IT Pros & Developers. It's quick & easy.

Code for "bucket-ized" time table???

P: n/a
Hello,

First, I want to apologize for posting this message to multiple
groups. (1) I have a hard time finding any info and (2) this is not a
school assignment.

I am trying to create in my Oracle test database a "time" table that
would have time buckets. What I mean is that, it would have some
structure like this

0-5 minute bucket
10-15 minute bucket
15-20 minute bucket
....
55-60 minute bucket
0-2 hour bucket
2-4 hour bucket
4-6 hour bucket
....
22-24 hour bucket
day number
week number
month number
year number

How can I go about doing this? I'm very new to data-warehousing and
have never had to this before. Any suggestions, code
snippets...anything is welcome!

Thanks in advance for any help you can provide!

KS.
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
New Guy wrote:
I am trying to create in my Oracle test database a "time" table that
would have time buckets. What I mean is that, it would have some
structure like this


Are you allowed to use Oracle capabilities, or do you need to be 'vendor
neutral'?

If you are allowed to take advantage of Oracle native capabilities,
hopefully you are using Oracle9i R2. Then look up the NTILE and
WIDTH_BUCKET functions, and the examples, in the Oracle supplied manual

Oracle9i Data Warehousing Guide
Release 2 (9.2)
Part Number A96520-01

available at http://docs.oracle.com ... (table of contensts at
http://download-west.oracle.com/docs...a96520/toc.htm)
Also I highly recommend a gander at 'Mastering Oracle SQL' from
http://oracle.oreilly.com/ as it gives the logic behind those functions -
as well as many many more SQL tricks that your typical developer misses.

/Hans
Jul 19 '05 #2

P: n/a
"New Guy" <ks***@adnohr.net> schrieb im Newsbeitrag
news:2e**************************@posting.google.c om...
I am trying to create in my Oracle test database a "time" table that
would have time buckets. What I mean is that, it would have some
structure like this

0-5 minute bucket
10-15 minute bucket
15-20 minute bucket
...
55-60 minute bucket
0-2 hour bucket
2-4 hour bucket
4-6 hour bucket
...
22-24 hour bucket
day number
week number
month number
year number


A vendor neutral approach could be to create an additional bucket dimension
(with a key column in your fact table) if each fact has this dimensionality.
This would allow your users to see how the bucket usage developed over time.

Kind regards,

Joerg
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.