| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Efficient date range search?
Pablo Sanchez wrote:
> 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" >>
Unfortunately, this will count pets that haven't been born by the date in question.
The obvious query will be:
select * from pet where my_date > born and (my_date < died or died is null)
See my other post below for some thoughts on how an RDBMS might optimise this.
Regards,
Kieran Elby
Received on Mon Oct 07 2002 - 14:21:14 CDT
![]() |
![]() |