Subject Re: [firebird-support] Re: Help with select statement
Author William L. Thomson Jr.
On Tue, 2005-06-28 at 07:58 +0000, Svein Erling Tysvær wrote:
> --- In firebird-support@yahoogroups.com, "William L. Thomson Jr."
> wrote:
>
> > I need one query that returns all records in table B.
>
> This is so simple that it either has to come from a complete newbie

Not really been around Firebird for many years. Just never queries of
this nature. Seems things get more complex over time. But I am also
starting to do more inside the engine than in the past. Which I would do
outside of the engine. Further binding apps to Firebird instead of
generic JDBC stuff.

In fact after my post I realized I made it more complicated. I should
have just asked if a subselect can return the differences between two
tables.

> select <something> from C
> where not exists (select * from B
> where B.<field> = C.<field>)

Basically what I did except I used WHERE C.<field> NOT IN?

select <something> from C
where C.<field> NOT IN (select B.<field> from B
where B.<field> = C.<field>)

Not exactly since there are other params to both where statements. Nor
am I sure what the difference would be or if results are basically the
same?

Never worked with sub-selects and etc yet. Very nice, pretty sure I will
be working with them more and more as time goes by.

--
Sincerely,
William L. Thomson Jr.
Support Group
Obsidian-Studios, Inc.
http://www.obsidian-studios.com