[thelist] MySQL Query Issue

Marcus Andersson marcus at bristav.se
Mon Nov 29 16:55:33 CST 2004


I'm not sure if this is what you want and it's MySQL 4.1 but...

SELECT
   P.productName,
   P.shortDesc,
   P.longDesc,
   GROUP_CONCAT(CS.classDate) as classDates
FROM
   PRODUCTS P LEFT JOIN CLASSES_SCHEDULE CS ON P.productID = CS.productID
GROUP BY
   P.productID

This results in one row/product with every class date in a comma separated list in classDates

/Marcus


More information about the thelist mailing list