X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 05F819FA5D2 for ; Wed, 7 Jun 2006 17:18:46 -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 71308-05 for ; Wed, 7 Jun 2006 17:18:35 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web33313.mail.mud.yahoo.com (web33313.mail.mud.yahoo.com [68.142.206.128]) by postgresql.org (Postfix) with SMTP id DDFD09FA2E6 for ; Wed, 7 Jun 2006 17:18:35 -0300 (ADT) Received: (qmail 75712 invoked by uid 60001); 7 Jun 2006 20:18:34 -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=UddvzUltvW/BGBPJEiiO5TLDqQy1zIFLCXkQWQtpA7YSkQbEuER5Fe1njrThlhgI1pIEYK6gr+blhLrF8ufuZxzUfVst13X3ahdZuWdOjYwm/epzQGD12ag0ksQERcuzw5xzIzw3hDG5zhdUVNGE0TsdsR8LNjdHuqm4MofigfY= ; Message-ID: <20060607201834.75710.qmail@web33313.mail.mud.yahoo.com> Received: from [12.9.179.126] by web33313.mail.mud.yahoo.com via HTTP; Wed, 07 Jun 2006 13:18:34 PDT Date: Wed, 7 Jun 2006 13:18:34 -0700 (PDT) From: Subject: Re: How To Exclude True Values To: Richard Broersma Jr , "pgsql-sql@postgresql.org" In-Reply-To: <20060607200736.6320.qmail@web31801.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/88 X-Sequence-Number: 25324 > > yields the following error: > > > > ERROR: schema "a" does not exist > > > > i tried to interpret you query and apply it to my > > case, but, apparently, i didn't too good of a job. > > > > do you see the error? > > Hmmm... That is strange. but according to the > PostgreSQL documentation on select you can add the > option [AS] keyword between the table_name and > alias. > > http://www.postgresql.org/docs/8.1/interactive/sql-select.html > [ ONLY ] table_name [ * ] [ [ AS ] alias [ ( > column_alias [, ...] ) ] ] > > ( select ) [ AS ] alias [ ( column_alias [, ...] > ) ] > > select a.inspect_id, a.inspect_result_id, > a.inspect_result_pass, > a.inspect_result_timestamp > from t_inspect_result AS a > > join > ( > select > max(t_inspect_result.inspect_result_timestamp) > as mstamp, > t_inspect_result.inspect_id > from t_inspect_result > group by t_inspect_result.inspect_id > ) AS b > > on a.inspect_result_timestamp = b.mstamp > ; Richard, i got the expected rewsults! now i just have to study the query to figure out what it does. -lol- i tried using AS, but i only did it in one place - doh! the error message just moved to the next place i didn't do it. i'll know better next time. thanks for the help. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com