🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Combine data 2 records

#718
From: MrT
Date: Sun, 05 Aug 2007 22:35
35 lines
1839 bytes
By the way, I ahve done this kind of thing before and I would rather SQL 
it directly: make temp table storing id and max d1 then insert max d2 
for same id.

MrT wrote:
> Hi:
> 
>  I have master and detail. Detail has year record with two dates say d1 
> & d2. I want  to get latest date for each.
> 
> 
> 
>  Table 2    Year       Id           d1               d2
>  Record 1   2007       1         10/15/2007       08/10/2007
> 
>  Record 2   2008       1                          08/10/2008
> 
> 
> 
> I want single output record with d1 = 10/15/2007 and d2 = 08/10/2008
> 
> 
> Tried this different way but either don't get all the records or 
> multiple records with the two d2 dates.
> 
> I have tried extracting form one linked table and also 2 linked copies 
> of table 2
> 
> How does one go about this?
> 
> 
> 
> Thanks.
> 
> Best regards
Technical Details
Message-ID: <46b64267@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <46b641b6@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,509bc3ea097a54b
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Sun, 05 Aug 2007 17:35:15 -0500
From: MrT <contact@heat-mi.org>
User-Agent: Thunderbird 1.5.0.12 (Windows/20070509)
MIME-Version: 1.0
Newsgroups: borland.public.interbase.sql
Subject: Re: Combine data 2 records
References: <46b641b6@newsgroups.borland.com>
In-Reply-To: <46b641b6@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.39.70.99
Message-ID: <46b64267@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1186349671 69.39.70.99 (5 Aug 2007 14:34:31 -0700)
Lines: 35
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail