Hello all,

Using two tables :

R1 :
id
data

R2 :
id
pid
type
data

R2.pid reference R1.id

I would like to have a result set that is all the rows from R1 which are
not referenced by any row from R2, but all this only for a certain type
(R2.type)

I've done this :

SELECT R1.* from R1 left join R2 on (R1.id=R2.pid) where R2.id is NULL;


The problem of such a statement is that the result set show me all the rows
from R1 which does not have ANY references in R2, and i would like to have
all rows from R1, which does not have any rows of a certain type in R2
(lets say R2.type="D").

Since this version of MySql doesn't support select statement inside another
statement, i really don't know how i can do this.


Thanks you for your help.

--
Vincent



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to