Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: how to generate the output w/o using temp table
Lex,
How does this compare to the Richard Snodgrass book 'Developing Time-Oriented
Database Applications in SQL'
(http://www.cs.arizona.edu/people/rts/tdbbook.pdf)?
Henry
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Lex de Haan
Sent: Monday, August 02, 2004 1:29 PM
To: oracle-l_at_freelists.org
Subject: RE: how to generate the output w/o using temp table
as an aside, if you are interested in some theory behind this type of problems, the following book is a must: Chris date, Hugh Darwen, and Nikos Lorentzos: "Temporal Data and the Relational Model" Morgan Kaufmann Publishers, ISBN 1-55860-855-9.
they introduce the concept of "packing" and "unpacking" data over the time dimension -- which is the generalization of the issue here.
Kind regards,
Lex.
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Daniel Fink
Sent: Monday, August 02, 2004 18:01
To: oracle-l_at_freelists.org
Subject: Re: how to generate the output w/o using temp table
Somehow, you need to iterate through a list of months between the start and end dates and find all records that fall within that range. If you have a calendar type table, you can use that. If not, you have to get creative. I've included some code below (part stolen from other posters, part from my own twisted mind). *IF* the number of months requested is greater that the number of rows in the vacation table, it will *not* work. A better solution would be to code it in PL/SQL or another language.
Regards,
Daniel Fink
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.htmlput 'unsubscribe' in the subject line.
-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to: oracle-l-request_at_freelists.org
![]() |
![]() |