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

From Richard Broersma Jr
Subject Re: How To Exclude True Values
Date
Msg-id 20060606023618.18392.qmail@web31815.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
> > 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.


pgsql-sql by date:

Previous
From:
Date:
Subject: Re: How To Exclude True Values
Next
From: "Christian Paul Cosinas"
Date:
Subject: Update Problem