Re: SQL/PL-SQL Question

From: Dave Mausner <dma956_at_lulu.acns.nwu.edu>
Date: 1995/07/12
Message-ID: <3u1apb$c44_at_news.acns.nwu.edu>#1/1


In article <3tuhjo$dpc_at_knot.queensu.ca>, Frampton Steve R <frampton_at_admin.flarc.edu.on.ca> wrote:
>
>Suppose I am given a start date and an end date of an employee absence.
>
>For example:
>
> Start: 950101 End: 950331
>
> [...]
This is hard to solve relationally because SQL wants to join tables on key matches and because you have specified ranges, the key values you want are often implied, within each range. a relational restatement would be to have a table of this year's dates (365 rows) with each day's absence credit rating (0 or 1); and your employee data would be entered daily one date per row, instead of with ranges. Then you can sum the absence credit values by joining the employee absence date table, using date as the join key. Each day of absence is worth either 0 or 1, hence the sums grouped by employee would be your solution.

--
Dave
Received on Wed Jul 12 1995 - 00:00:00 CEST

Original text of this message