Re: Complex Query

From: Suresh Easwar <suresh.easwar_at_citicorp.com>
Date: 1996/04/05
Message-ID: <31656043.46A6_at_citicorp.com>#1/1


select distinct a.*
from req a, req b
where a.room = b.room
  and abs(a.enter_date - b.enter_date) <= 14   and a.rowid != b.rowid
order by a.room, a.enter_date

enjoy a cup of coffee while this chugs away! suresh

Danny Hughes wrote:
>
> I need help with sql syntax for the following:
>
> I have a table called req that has the following fields, wo_number,
> room, enter_date, crew, description. I am trying to get a listing of
> possible duplicate work orders for each room. To be considered a
> possible duplicate, the work orders for each room will have a start date
> within two weeks of each other. I can get a complete listing by room and
> start date order but it consist of everything and all I am interested in
> is only the ones that have the start date within the 2 week period.
 

> Thanks in advance
> Danny Hughes
Received on Fri Apr 05 1996 - 00:00:00 CEST

Original text of this message