Subject Re: [firebird-support] Intersections
Author Dimitry Sibiryakov
On 20 May 2004 at 12:04, Terry Johnson wrote:

>I've been looking on the net for a soultion to a problem, and seem to be
>missing something in firebird...

AFAIU, you've missed joins.

>The situation is I have two tables of items (say A and B). A third table
>lists groups each item belongs to (G), where A and B may have multiple
>references in G.
>
>I want a query that, given a member of A, returns a list of all of B
>that belong to any group A is a member of.

select b.whatever_you_want from a join g on a.g=g.id join b on
b.g=g.id where a.something = :what_you_have

SY, Dimitry Sibiryakov.