Re: How To Exclude True Values - Mailing list pgsql-sql

From Richard Broersma Jr
Subject Re: How To Exclude True Values
Date
Msg-id 20060607200736.6320.qmail@web31801.mail.mud.yahoo.com
Whole thread Raw
In response to Re: How To Exclude True Values  (<operationsengineer1@yahoo.com>)
Responses Re: How To Exclude True Values
List pgsql-sql
> 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
;

Regards,

Richard Broersma Jr.


pgsql-sql by date:

Previous
From:
Date:
Subject: Re: How To Exclude True Values
Next
From:
Date:
Subject: Re: How To Exclude True Values