Subject Re: [firebird-support] Help with select statement
Author Ann W. Harrison
William L. Thomson Jr. wrote:
> I have two tables that I need to query, ... linked via foreign keys to
> one main table. Table names are A,B,C with the main one being A.
>
> Now when data is put into table B it can also go into table C as well. I
> basically need to get the differences between tables B and C in two
> queries. Table B having unique data, and table C having that same data,
> and more.
>
> I need one query that returns all records in table B.

select <field list> from B

I'm sure I've missed something but that's the usual way of asking for
all records from a table.

> Then another query
> that returns only the records in C, that are not in B.

select <field list> from c
where not exists (select 1 from b where b.field1 = c.field1
and b.field2 = c.field2 ...)


What have I missed?


Regards,


Ann