Forum Moderators: open

Message Too Old, No Replies

[Mysql] Joining tables and merging column output

Can this be done with mysql?

         

gerwin

2:36 am on Nov 8, 2007 (gmt 0)

10+ Year Member



Hallo i am searching for the sollution for this problem a while now and i am thinking of the fact this really isnt possible. I have the following mysql code:


SELECT
Product, Image, ProductTitle.Title as ProductTitle, ImageTitle.Title as ImageTitle
FROM
Company
LEFT JOIN Product ON Company.CompanyID = Product.CompanyID
LEFT JOIN Product2Image ON Product.ProductID = Product2Image.ProductID
LEFT JOIN Image ON Product2Image.ImageID = Image.ImageID

LEFT JOIN Product2Title ON Product.ProductID = Product2Title.ProductID
LEFT JOIN Image2Title ON Image.ImageID = Image2Title.ImageID

LEFT JOIN Title ProductTitle ON Product2Title.TitleID = ProductTitle.TitleID
LEFT JOIN Title ImageTitle ON Image2Title.TitleID = ImageTitle.TitleID

Next i want to show the ProductTitle.Title and ImageTitle.Title in one column creating more rows that way and keeping the 'original' data in the rows. Is this possible?

coopster

11:39 pm on Nov 8, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Yes, I believe so if I understand correctly. You should be able to use a UNION query to get the intended result set.