Subject | Re: [IBO] SQL Help |
---|---|
Author | p3pp3rh3ad |
Post date | 2008-01-30T21:36:41Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
combination for which there is no match. Outer joins include
combinations by one of 3 rules. The left join rule dictates that the
set will have at least one row for each row in the "left" table,
whether matching links exist or not; and multiple rows for each
match that exists. Join logic *alone* can't give you a set that
represents a 1:many relationship as an exclusive set comprising all
and only unique master records.
linked "detail" records in table B, then do a single-table query for
A and another single table query for B, that includes the FK columns,
and link the two sets in a master-detail relationship.
OK, this column is supposed to represent the "last order date" from
table B. I want to provide the option of sorting the customer table
by this column. I thought I had it working until I realized that new
customers weren't being shown at all!
>the
> At 07:11 AM 31/01/2008, you wrote:
> >I want to add a column to a TIB_Grid that is currently displaying
> >contents of table A via an TIB_Query. The new column is from tableB
> >which is linked to A with a foreign key.items
> >
> >The problem is that there isn't necessarily a record in table B
> >corresponding to each item in A. Also there may be multiple B
> >corresponding to an A item. If I do a join, I don't see the Aitems
> >that lack an entry in B.multiple B entries.
>
>
> >If I do a left join, I get multiple rows for the A items that have
>stored in multiple related tables. Inner joins exclude any
> That's true. :-) The purpose of a join is to "flatten" the data
combination for which there is no match. Outer joins include
combinations by one of 3 rules. The left join rule dictates that the
set will have at least one row for each row in the "left" table,
whether matching links exist or not; and multiple rows for each
match that exists. Join logic *alone* can't give you a set that
represents a 1:many relationship as an exclusive set comprising all
and only unique master records.
>the "master records" in table A and can reach all of the
> If you want to represent this relationship so that your UI sees
linked "detail" records in table B, then do a single-table query for
A and another single table query for B, that includes the FK columns,
and link the two sets in a master-detail relationship.
>could get closer to a suggestion of how to implement it.
> If you would explain how you want to use this dependent column, we
>Thanks, Helen
OK, this column is supposed to represent the "last order date" from
table B. I want to provide the option of sorting the customer table
by this column. I thought I had it working until I realized that new
customers weren't being shown at all!