Trying to see if I can do the attached without PL/SQL

From: JAW <jwilliam_at_aglresources.com>
Date: Fri, 25 Jan 2008 13:50:52 -0800 (PST)
Message-ID: <12c7292b-10cc-4ba0-a22d-81002c51f78c@d4g2000prg.googlegroups.com>


REM table q;

create table q ( premise_no number, DUE_ON_DTTM date);

--

Insert into q (PREMISE_NO, DUE_ON_DTTM) Values

(966034975,TO_DATE('10/01/2007 12:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into q (PREMISE_NO, DUE_ON_DTTM) Values
(966034975,TO_DATE('11/01/2007 16:00:00', 'MM/DD/YYYY HH24:MI:SS'));
Insert into q (PREMISE_NO, DUE_ON_DTTM) Values
(966034975,TO_DATE('11/28/2007 23:59:00', 'MM/DD/YYYY HH24:MI:SS'));
COMMIT; In the above dataset I would want to find all matching PREMISE_NO where the DUE_ON_DTTM are within 30 days of each other. So in the above the last two rows inserted would be what I would want to returned to me for each group of 3 premises because 11-1-2007 and 11-28-2007 are within 30 days of each other since the PREMISE_NO is the same. I can do it with PL/SQL or DOTNET code but trying to see if it can be done with just analytics and INLINE views.
Received on Fri Jan 25 2008 - 15:50:52 CST

Original text of this message