On Wed, 2007-01-17 at 11:47 -0600, Peter Brawley wrote:
> Daniel,
>
> CREATE TABLE tbl (
> lab_number int(11) default NULL,
> result int(11) default NULL,
> release_time datetime default NULL
> );
> select * from tbl;
> +++-+
> | lab_number | result |
Daniel,
CREATE TABLE tbl (
lab_number int(11) default NULL,
result int(11) default NULL,
release_time datetime default NULL
);
select * from tbl;
+++-+
| lab_number | result | release_time|
+++-+
|
On Wed, 2007-01-17 at 09:56 -0600, Peter Brawley wrote:
> Daniel,
>
> >find the lab_number where ALL the tests have been performed and
> >not the lab_numbers which have partial results.
>
> SELECT t1.lab,t1.res,t1.dt
> FROM tbl t1
> WHERE NOT EXISTS(
> SELECT lab FROM tbl t2 WHERE t1.lab=t2.lab
Daniel,
find the lab_number where ALL the tests have been performed and
not the lab_numbers which have partial results.
SELECT t1.lab,t1.res,t1.dt
FROM tbl t1
WHERE NOT EXISTS(
SELECT lab FROM tbl t2 WHERE t1.lab=t2.lab AND t2.res IS NULL
);
The decorrelated version uses an exclusion join, r
I have a table with numerous columns but needing to perform a query
based on three columns:
Lab_number, result, release_time.
What I want to do is search for lab_number where there is a result but
not released. The problem that is making this difficult for me, is that
there are multiple entries