>> >> SELECT R1.* from R1 left join R2 on (R1.id=R2.pid) where R2.id is
NULL;
>> What i need is to have a result that list only the R1 rows which does
not
>> have any references of type "D".
>
>Aha, you have more than one record in R2 which is linked to R1.
>
>Hmmm.. you can select the pid's from
> >> SELECT R1.* from R1 left join R2 on (R1.id=R2.pid) where R2.id is NULL;
> What i need is to have a result that list only the R1 rows which does not
> have any references of type "D".
Aha, you have more than one record in R2 which is linked to R1.
Hmmm.. you can select the pid's from R2 which
>> 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
> 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 i
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