🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #952

Re: actual(Date1) - next(Date2)

#952
From: aleplgr
Date: Thu, 22 Mar 2007 14:17
33 lines
2529 bytes
"Patrick Moloney" <NewsID*at*SandrockSoftware.c*o*m> wrote:
>aleplgr wrote:
>
>> 
>> "Patrick Moloney" <NewsID*at*SandrockSoftware.c*o*m> wrote:
>> > Why do you want to "return a table"?  This sounds like you don't
>> > want separate client tables in Interbase? How many clients are
>> > there? Is that a lot of tables?
>> > 
>> > -- 
>> > Patrick Moloney
>> 
>It's hard understanding what you need to do.  Each message you post
>gives a little more information about what you want. You also include
>bits of your proposed solution - tables etc.  You would probably get a
>better response with less guessing by everyone if you put the effort to
>make a clear and complete statement of what you need to do, and leave
>out your suggestions for the solution in this step one.  It is often
>said that asking the right question is more than half the answer.
>
>-- 
>Patrick Moloney


OK, I didn't mean to be confusing.
I have a 3 columns table: ClientID, Date1 and Date2.
There are at most 1000 different ClientIDs and 10000 rows in this table, it's ordered by ClientID and Date1.
For each ClientID there's at least one pair (Date1,Date2) and at most 10 pairs (Date1,Date2).
I need to return one table with 2 columns: ClientID and Date1 where
if the difference between the actual Date1 and next(Date2) >30 return actual Date1 else if there is no such difference >30 return the greatest Date1 for the actual ClientID. 
next(Date2) is the Date2 that is in the next row of the actual ClientID.
The DBMS is InterBase 7.5 
Technical Details
Message-ID: <460281d1$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4601ab4c$1@newsgroups.borland.com> <4601d64f$1@newsgroups.borland.com> <46024306$1@newsgroups.borland.com> <46027137$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,dd90eb1b1157ce03
X-Google-Attributes: gid114a0e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "aleplgr" <aleplgr@yahoo.es>
Sender: "aleplgr" <aleplgr@yahoo.es>
Reply-To: "aleplgr" <aleplgr@yahoo.es>
Subject: Re: actual(Date1) - next(Date2)
Newsgroups: borland.public.interbase.sql
X-User-Info: 80.58.205.38     
X-Forwarded-For: 80.25.195.180, 192.168.1.55
References: <4601ab4c$1@newsgroups.borland.com> <4601d64f$1@newsgroups.borland.com> <46024306$1@newsgroups.borland.com> <46027137$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <460281d1$1@newsgroups.borland.com>
Date: 22 Mar 2007 06:17:05 -0800
X-Trace: newsgroups.borland.com 1174569425 207.105.83.66 (22 Mar 2007 06:17:05 -0800)
Lines: 39
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail