pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: operationsengineer1@yahoo.com
To: Richard Broersma Jr <rabroersma@yahoo.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: How To Exclude True Values
Date: Wed, 7 Jun 2006 13:18:34 -0700 (PDT)
Message-ID: <20060607201834.75710.qmail@web33313.mail.mud.yahoo.com> (raw)
In-Reply-To: <20060607200736.6320.qmail@web31801.mail.mud.yahoo.com>

> > 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 



view thread (17+ messages)  latest in thread

Message-ID: <20060607201834.75710.qmail@web33313.mail.mud.yahoo.com>
Permalink:  ../20060607201834.75710.qmail@web33313.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/20060607201834.75710.qmail@web33313.mail.mud.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: operationsengineer1@yahoo.com, rabroersma@yahoo.com
  Subject: Re: How To Exclude True Values
  In-Reply-To: <20060607201834.75710.qmail@web33313.mail.mud.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox