Joe Yoder wrote:
> I should have pointed out that the Jobs table is related to the Members 
> table rather than the Family table.  I attempted  to join the member and 
> job tables first and then join the member table to the family table but 
> couldn't figure out how to do so.  The sample code I presented was 
> intended to show how the tables are linked.  I realize now that it does 
> use a join.  I didn't show my actual code assuming it might be simpler 
> for a Pro to simply give me a solution that works rather than trying to 
> figure out my approach.
>
> Thanks - Joe
>   
Ok, let's see if I can explain it simply.
select * from table where condition --- The where condition gets the
whole set of results and prunes them accordingly
select *
    from table
    inner join table2
       on cond1 and cond2
    where condition                  -- here cond1 and cond2 refer to
the way table and table2 are matched together, once you do that
                                              -- condition will prune
the result of the join.

an INNER JOIN will get every record from table and pair it with every
record of table2, that is if table has M records and table2 has N
records you'll get at most M*N records, but only those that comply with
cond1 and cond2.
a LEFT JOIN will do the same but all the table1 records will be there,
if there is no table2 record to match then the corresponding table2
fields will be NULL.You'll get at least M records.
a RIGHT JOIN is the same as a LEFT JOIN but where it says table it
should say table1 and viceversa. You'll get at least N records
a FULL JOIN guarantees that all records of table and all records of
table2 will be there (with NULLS if there is no pairing from the other
table). You'll get at least M*N records (more if more than one record
from one table may be paired with a record of the other).

HTH


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to