Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL - table holds to dates, I want to retrive all dates in a period of time
"Anders F." <afromyr_at_hotmail.com> wrote in message
news:b7aaadbb.0402200456.564ff0dd_at_posting.google.com...
| Hi
|
| My problem is that i have a table with a from_Date and a to_date.
| this table holds information about a persons sickdays.
|
| Lets say that the table contains the following info
| Employee - from_date - to_date
| 2604 - 14.02.2004 - 03.03.2004
| 5064 - 16.02.2004 - 17.02.2004
| 2604 - 01.01.2002 - 01.01.2002
| 2359 - 01.05.2003 - 01.05.2004
|
| I want to ask who whas sick between 01.01.2004 and 01.03.2004
| And get a list of all employees that has sickdays that is in this period
|
| Employee - from_date - to_date
| 2604 - 14.02.2004 - 03.03.2004
| 5064 - 16.02.2004 - 17.02.2004
| 2359 - 01.05.2003 - 01.05.2004
|
| How would I write the where sentence to get this info?
| select * from tbl where ?
think about what your own decision making process is as you look at each row
for example
"was emp #2604, who was sick from 14.02.2004 - 03.03.2004, one of the people who was sick between 01.01.2004 and 01.03.2004?"
how would you answer that without SQL? once you figure that out, then you need to translate it into a working predicate clause
figure out the logic, give a stab at converting it to SQL, then post your attempts
;-{ mcs Received on Fri Feb 20 2004 - 10:24:45 CST
![]() |
![]() |