Hi, Ive'd seen this article (http://dev.mysql.com/doc/refman/5.6/en/subquery-optimization.html) and hoping that this article will fix my slow query. I want it to apply this in my statement but please help me how do I do it. Here is my statement.
SELECT DISTINCT product.class_code, product.fitting_code, product.running_number, product.color_code, color_codes.color_desc, retail_price, isActive, b26, b27, b28, b29, b30, b31, b32, b33, b34, b36, b38, b40, b42, b44, tFS, tS, tM, tL, tXL, t2XL, t3XL, t4XL, t5XL, DATE_FORMAT(last_incoming, '%Y-%m-%d'), DATE_FORMAT(last_outgoing, '%Y-%m-%d') FROM product, stock_levels, color_codes WHERE product.class_code = stock_levels.class_code AND product.fitting_code = stock_levels.fitting_code AND product.running_number = stock_levels.running_number AND product.color_code = stock_levels.color_code AND product.color_code = color_codes.color_code AND stock_levels.color_code = color_codes.color_code;