| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Efficient date range search?
Pablo Sanchez <pablo_at_dev.null> wrote in
news:Xns92A07011F6EE7pingottpingottbah_at_209.189.89.243:
> Assuming you're using one of the three, the query would be:
>
> select count(*) from pet where died <= "date/time value"
>
Forgot a case... the above only handles when a pet has died and you've stamped the row with the date of their ... expiration. when a pet is still alive, the assumption is that 'died' will be set to NULL and we need that in the predicate:
SELECT count(*)
FROM pet
WHERE died <= <<date/time value>>
OR died IS NULL
Sorry for any confusion.
-- Pablo Sanchez, High-Performance Database Engineering http://www.hpdbe.comReceived on Mon Oct 07 2002 - 13:29:10 CDT
![]() |
![]() |