X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id A84AA9FA5CE for ; Wed, 7 Jun 2006 22:03:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 94801-05 for ; Wed, 7 Jun 2006 22:03:22 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web31812.mail.mud.yahoo.com (web31812.mail.mud.yahoo.com [68.142.207.75]) by postgresql.org (Postfix) with SMTP id 97BAF9FA3C0 for ; Wed, 7 Jun 2006 22:03:22 -0300 (ADT) Received: (qmail 70609 invoked by uid 60001); 8 Jun 2006 01:03:21 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=qgRrkB+Z5BghP9/L38WwguLGSwCMGMtSK/fTOzh8BHWb38S3jwWSqOlRwkXG7SYmSXxPFXwaX7quyfP6h1MnMVHLMtkKuHMpYaz60OScCpZjmrgv0a05M+qOsX3/Iwg9BUvSNdHIGI3Bz4xisAKIEqynxT9ges8S4EjFeSgxtV8= ; Message-ID: <20060608010321.70607.qmail@web31812.mail.mud.yahoo.com> Received: from [68.235.218.116] by web31812.mail.mud.yahoo.com via HTTP; Wed, 07 Jun 2006 18:03:21 PDT Date: Wed, 7 Jun 2006 18:03:21 -0700 (PDT) From: Richard Broersma Jr Subject: Re: How To Exclude True Values To: operationsengineer1@yahoo.com, "pgsql-sql@postgresql.org" In-Reply-To: <20060607232928.51859.qmail@web33310.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/91 X-Sequence-Number: 25327 > i think i've figured out the gist of the thought > process behind the SQL query... > > 1. select everything from t_inspect_result as table a > 2. select max timestamp value entries in > t_inspect_result as table b > 3. choose only choose those rows where the max > timestamps of table a and b are equal. > > is that about it? The one problem with query would be if there is a possibility that two differnt tests will have the exact same time stamp. If that is a possibility, then you could use the exact same query structure but replace Max(timestamp) with max(inspect_result_id) and then join on inspect_result_id instead. Regards, Richard Broersma