Matthew Shalorne wrote:
Hi,
with the tables eg:
Product: id, product, cost
ProductTag: productId, TagId
Tag: id, tag
I have created the ability to selectively assign tags to products if
required via a many-to-many relationship.
Now I want to join the tables in MySQL so that I can see all products
and in the tag column they should have a tag if there is one. I can do
the left outer join to join the product and many-to-many table
ProductTag:
select Product.id, ProductTag.TagId from Product left join ProductTag
on Product.id = ProductTag.productId
select Product.id,Product.cost,Tag.tag
from product left join ProductTag on Product.id=ProductTag.productid
left join Tag on ProductTag.TagId=Tag.id
but how do I then, in the same, select statement describe the join
between ProductTag and Tag to produce the columns:
Product.product, Product.cost, Tag.tag
where most Tag.tag fields will not have values.
I would hugely appreciate any assistance in this regard.
Matthew
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]