Skip site navigation (1) Skip section navigation (2)

SQL Question

From: <operationsengineer1(at)yahoo(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: SQL Question
Date: 2006-01-07 00:02:53
Message-ID: 20060107000253.90083.qmail@web33310.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
and another sql question...

greatly simplified info:

t_sn
sn_id
sn

t_inspect
inspect_id
sn_id (fkey)
inspect_pass (boolean)

i want to display all sns where there is not a single
instance of inspect_pass = t

iow, a sn may have 1 inspection - t or 4 inspections -
f, f, f, t or any number of inspections as long as
they are 1. all f or 2. they are f up until the final
t value.

in php, i'd run a select where inspect_pass = true and
test to see if the recordset contained a value or not.

in this case, it is required that sql itself generate
the correct result, if possible.

tia...

my app actually has about 6 distinct test areas, each
requiring this test, but i thought i'd KISS it so the
request is clear.  eventually, i will want to test
that all prior inspections ended in t before allowing
the user to input the current inspection...

app minutae can wear a guy down!


		
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 


Responses

pgsql-novice by date

Next:From: meDate: 2006-01-07 00:28:07
Subject: primary key on lower(varchar)
Previous:From: Andrew ChambersDate: 2006-01-06 20:04:01
Subject: Re: Problem when trying to compile and link program on Windows to libpq

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group