From derby-user-return-11167-apmail-db-derby-user-archive=db.apache.org@db.apache.org Sat Jun 20 22:05:58 2009 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 95942 invoked from network); 20 Jun 2009 22:05:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Jun 2009 22:05:57 -0000 Received: (qmail 90317 invoked by uid 500); 20 Jun 2009 22:06:08 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 90238 invoked by uid 500); 20 Jun 2009 22:06:07 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 90230 invoked by uid 99); 20 Jun 2009 22:06:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jun 2009 22:06:07 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dmclean62@gmail.com designates 209.85.210.185 as permitted sender) Received: from [209.85.210.185] (HELO mail-yx0-f185.google.com) (209.85.210.185) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jun 2009 22:05:58 +0000 Received: by yxe15 with SMTP id 15so3347263yxe.5 for ; Sat, 20 Jun 2009 15:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=69hpu94jv26oaCZWynPD5J/wDp3eB74HTMvVIXdvj8g=; b=x4sAYeLgaaW115QaKzljhJv4+HoOUOO2AoU1IgpOlpM8RY5oTVv4oPq9iM3lY6DSyU AoDGaiOR2QxcTptyxdMn9c9DiawRytp880J+ODCNjug5gpCJ5gXCICJdEz7/j/klglh/ MIwxu5bxN/Pk07HQ1RdF2dByRFr1iR1YQkmL0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=O+AnmTmEjAwqm9wv2T39uAdqNwr8/iy057TNmo7mIkYKeEEF9/vDG8iQ/rYR6tab4U QJ9Af1OxKQgQbeV3cvSBkNCr98qzdLktym5FI3NIA6JXQx7bv2Gbipb683eFUI0cLkcE hwvY+t+rv0TnlixVNm8sJTiXDkgtn6+oEZvBA= MIME-Version: 1.0 Received: by 10.100.142.19 with SMTP id p19mr5822081and.13.1245535513909; Sat, 20 Jun 2009 15:05:13 -0700 (PDT) In-Reply-To: <2822C5AB644C4B24BBFEF82094DD9EFD@KaydellsPortabl> References: <2822C5AB644C4B24BBFEF82094DD9EFD@KaydellsPortabl> Date: Sat, 20 Jun 2009 18:05:13 -0400 Message-ID: <5627810d0906201505p1744592ek884eaa0b9b6e9365@mail.gmail.com> Subject: Re: Question About Selecting Only Some Records in a Join Query From: Donald McLean To: Derby Discussion , Kaydell On His PC Content-Type: multipart/alternative; boundary=0016e644d6eedc9f72046cced543 X-Virus-Checked: Checked by ClamAV on apache.org --0016e644d6eedc9f72046cced543 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit It seems to me that you could probably use a subquery to get the last date of service. It's a bit more complicated with separate fields for the date parts. You might even have to use nested subqueries. Get the largest service year, use that as a key and get the largest month for records in that service year and then get the largetst service day in that service year/month and then use that to select records from the table. --0016e644d6eedc9f72046cced543 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It seems to me that you could probably use a subquery to get the last date = of service. It's a bit more complicated with separate fields for the da= te parts. You might even have to use nested subqueries. Get the largest ser= vice year, use that as a key and get the largest month for records in that = service year and then get the largetst service day in that service year/mon= th and then use that to select records from the table.
--0016e644d6eedc9f72046cced543--