I've just upgraded from MySQL 4.0.13 to 5.0.41 and all my code works fine except for the SQL statement below. I've determined that the problem is the LEFT JOIN part, i.e. if I remove it the rest of the statement works ok, however I do need to have p.rating in so it's not really an option to leave it out.
I've searched the web and tried all different JOIN combinations but to no avail. Is it possible that someone here could kindly tell me why the statement below doesn't work now under 5.0.41 and what would be the best way to fix it.
Many thanks.
BTW, my computer is XP Pro with Apache 2.0.59 and ActivePerl 5.8.8.82
SELECT DISTINCT(CONCAT_WS(' ', e.manufacturer, e.model)) AS product, c.category, p.rating
FROM electronics AS e
INNER JOIN categories AS c ON c.sid=e.sid
LEFT JOIN product_rating AS p ON p.product=CONCAT_WS(' ', e.manufacturer, e.model)
WHERE c.category='Televisions'
GROUP BY product
ORDER BY product ASC