Subject Re: [ib-support] is it possible to....
Author Claudio Valderrama C.
"Bert Neef" <bert@...> wrote in message
news:4.3.2.7.2.20020211211149.03b4f078@localhost...
> return a selection of rows from table A based on wether the value of the
> primary key of a row isn't found in a certain column in table B. (or is
> found)? if yes : how?

select A.a
from A left join B
on A.pk = B.fld
WHERE B.fld is null;

select A.a from A
where not exists(select * from B where B.fld = A.pk);

There's a third way, using the IN operator, but it's the slowest way. There
are at least 3 ways more to do the same.

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing