Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: select rows from multiple date ranges.
Piyush wrote:
> Hi,
>
> I've been using basic SQL for a while, but this one has me puzzled. I
> am hoping somebody out there knows how to accomplish this. I need to
> view log entries from a table that exist between multiple date ranges.
> example:
>
> row timestamp ref_item item_des
> --- ---------- --------- ---------
> 1 4/7/2005 xxx xxxx
> 2 4/7/2005 process initialized.
> 3 4/7/2005 xxx xxxx
> 4 4/7/2005 xxx xxxx
> 5 4/7/2005 xxx xxxx
> 6 4/7/2005 process completed.
> 7 4/7/2005 xxx xxxx
> 8 4/7/2005 xxx xxxx
> 9 4/8/2005 process initialized.
> 10 4/8/2005 xxx xxxx
> 11 4/8/2005 xxx xxxx
> 12 4/8/2005 xxx xxxx
> 13 4/8/2005 process completed.
> 14 4/9/2005 xxx xxxx
>
> I need to select all log entries that occur between the
> process/initalized and process/completed, but nothing outside that
> range. so in this example, i would only select rows 2-6 and rows 9-13.
> any ideas?
>
> Thanks,
Might be a good place to use an in-line view to pull the initialized rows, another for the completed rows, and then join based on the two views.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Fri Apr 08 2005 - 17:31:09 CDT
![]() |
![]() |