From: operationsengineer1@yahoo.com
To: operationsengineer1@yahoo.com, "pgsql-sql@postgresql.org" <pgsql-sql@postgresql.org>
Subject: Re: Refactor Query... SOLVED
Date: Mon, 12 Jun 2006 13:19:55 -0700 (PDT)
Message-ID: <20060612201955.96030.qmail@web33303.mail.mud.yahoo.com> (raw)
In-Reply-To: <20060612181142.30113.qmail@web33304.mail.mud.yahoo.com>
--- operationsengineer1@yahoo.com wrote:
> hi all,
>
> i'm trying to refactor this query:
>
> http://www.rafb.net/paste/results/RnkFWZ46.html
>
> i've added notes to make its function a bit more
> clear. i have trie dto refactor it to get rid of
> the
> "distinct on" function, but i've had no luck.
>
> due to all the WHERE clauses, i can't figure out how
> to do an inner join with something like this:
>
> 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
>
> thanks in advance...
these queries (i have them all over my app!) are
getting complex and i'm being challenged to keep
everything in order.
this is the final result:
http://www.rafb.net/paste/results/pnvLSs30.html
here's a special thanks to all who have helped on this
and other recent query problems.
thank you!
i *rally* appreciate the chared insight and guidance.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
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
Subject: Re: Refactor Query... SOLVED
In-Reply-To: <20060612201955.96030.qmail@web33303.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