pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Broersma Jr <rabroersma@yahoo.com>
To: operationsengineer1@yahoo.com, "pgsql-sql@postgresql.org" <pgsql-sql@postgresql.org>
Subject: Re: How To Exclude True Values
Date: Mon, 5 Jun 2006 19:36:18 -0700 (PDT)
Message-ID: <20060606023618.18392.qmail@web31815.mail.mud.yahoo.com> (raw)
In-Reply-To: <20060606020714.61758.qmail@web33304.mail.mud.yahoo.com>


> > how can i exclude true values for this query?
> > 
> > http://www.rafb.net/paste/results/obtkGz26.html
> > 
> > if i uncomment out 
> > 
> > --    AND t_inspect_result.inspect_result_pass = 'f'
> > 
> > it looks for prior falses within an inspect_id and
> > returns it.  i want the original result set minus
> > the
> > trues, if possible.
> > 
> > tia...
> 
> this SQL appears to do the trick...
> 
> http://www.rafb.net/paste/results/zZKIjH80.html

I have one idea that hopefully wont complicate you query but it could simplfy your query by
getting rid of the query nexting.  Also,  I haven't tested it.

Basically,  Replace the 
DISTINCT ON (t_inspect.inspect_id) 

construct with 

GROUP BY t_inspect.inspect_id
HAVING t_inspect_result.inspect_result_pass = 'f'


Regards,

Richard Broersma Jr.



view thread (17+ messages)  latest in thread

Message-ID: <20060606023618.18392.qmail@web31815.mail.mud.yahoo.com>
Permalink:  ../20060606023618.18392.qmail@web31815.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/20060606023618.18392.qmail@web31815.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: rabroersma@yahoo.com
  Subject: Re: How To Exclude True Values
  In-Reply-To: <20060606023618.18392.qmail@web31815.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