Re: Code for "bucket-ized" time table???
Date: Tue, 18 May 2004 23:43:11 GMT
Message-ID: <jcxqc.11738$RM.1231_at_edtnps89>
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/cd/B10501_01/server.920/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 Received on Wed May 19 2004 - 01:43:11 CEST