David,
Thanks again for the reply.
I'm afraid this is way beyond my ability right now, therefore
I hope you
or someone else will be able to help me create this seemingly
impossible
join. Below is the full SQL as I have it now.
> SELECT products.mod_num, products.div_id,
products.group_id,
> products.seg_id, products.cat_id, products.title,
products.`desc`,
> products.thick, products.width, products.height,
products.project,
> products.image, `group`.group_name, category.cat_name,
> divisions.div_name, segment.seg_name
> FROM products, `group`, category, divisions, segment
> WHERE products.group_id = `group`.group_id AND
products.cat_id =
> category.cat_id AND products.div_id = divisions.div_id
AND
> products.seg_id = segment.seg_id
> ORDER BY products.mod_num
Following are the Tables and their fields:
PRODUCTS DIVISIONS GROUP
SEGMENT CATEGORY
prod_id prim., not null, auto-inc. div_id
group_id seg_id cat_id
mod_num not null div_name
group_name seg_name cat_name
div_id not null
group_id not null
seg_id null
cat_id null
title null
desc null
thick null
width null
height null
project null
image not null
As you can see, of the foreign keys, only div_id and group_id
are not
null, seg_id and cat_id allow null. I tried to create a left
join but
it didn't work because I need to join more than two tables:
> SELECT products.mod_num, products.div_id,
products.group_id,
> products.seg_id, products.cat_id, products.title,
products.`desc`,
> products.thick, products.width, products.height,
products.project,
> products.image, `group`.group_name, category.cat_name,
> divisions.div_name, segment.seg_name
> FROM products left join `group`, category, divisions,
segment
> ON products.group_id = `group`.group_id AND
products.cat_id =
> category.cat_id AND products.div_id = divisions.div_id
AND
> products.seg_id = segment.seg_id
> ORDER BY products.mod_num
Any help would be greatly appreciated. If worse comes to
worst I may
need to have the repeat region show the numeric version of
each foreign
key and just have a cheat-sheet handy to decipher.
Thanks,
Brett