Subject RE: [firebird-support] Is it possible to do this query?
Author Helen Borrie
At 04:15 PM 12/03/2006, you wrote:
>Yes, Billing is related to Payment in a one to many relationship. So I kind
>of want a "transaction log" where I have one billing line followed by all
>the payments on that line.

OK, so what does the referential relationship look like? i.e. which
column in Payment references the primary key or unique constraint in Billing?


>It's medical so each item has payments applied specifically to it.
>
>Typically the co-pay, then an insurance payment and then a write off. I am
>actually currently reading in your book about Unions as Adam suggested...am
>I barking up the right tree?

A union is the only way you are going to get columns (which must be
type-compatible) from different tables to output in different rows of
a single set.

But more to the point at the moment is what you've got to correlate
the many payments to the single billing. Since you don't have it in
the structure you provided, I assume you have an intersection table?

./heLen