SELECT MIN(tbl_colour.colour_id) AS colour_id, pd_department, pd_category, pd_department_display, pd_category_display, tbl_products.pd_code, pd_name, pd_price, pd_latest_release, pd_latest_release_expiry FROM `tbl_products` INNER JOIN `tbl_colour` ON tbl_products.pd_code = tbl_colour.pd_code WHERE (()) AND pd_status='show' AND ( size2_3>0 OR size3_4>0 OR size4_5>0 OR size5_6>0 OR size6_7>0 OR size7_8>0 OR size8>0 OR size10>0 OR size12>0 OR size14>0 OR size16>0 OR sizeaccessories>0 OR sizetightssmall>0 OR sizetightsmedium>0 OR sizetightslarge>0 OR sizeshoeaus8_euro24>0 OR sizeshoeaus9_euro26>0 OR sizeshoeaus10_euro28>0 OR sizeshoeaus12_euro30>0 OR sizeshoeaus13_euro32>0 OR sizeshoeaus2_euro34>0 OR sizeshoeaus4_euro36>0 OR sizeshoeaus6_euro38>0 OR sizeshoeaus8_euro40>0 ) GROUP BY tbl_colour.pd_code ORDER BY display_order DESC, id DESC
SELECT MIN(tbl_colour.colour_id) AS colour_id, pd_department, pd_category, pd_department_display, pd_category_display, tbl_products.pd_code, pd_name, pd_price, pd_latest_release, pd_latest_release_expiry FROM `tbl_products` INNER JOIN `tbl_colour` ON tbl_products.pd_code = tbl_colour.pd_code WHERE (()) AND pd_status='show' AND ( size2_3>0 OR size3_4>0 OR size4_5>0 OR size5_6>0 OR size6_7>0 OR size7_8>0 OR size8>0 OR size10>0 OR size12>0 OR size14>0 OR size16>0 OR sizeaccessories>0 OR sizetightssmall>0 OR sizetightsmedium>0 OR sizetightslarge>0 OR sizeshoeaus8_euro24>0 OR sizeshoeaus9_euro26>0 OR sizeshoeaus10_euro28>0 OR sizeshoeaus12_euro30>0 OR sizeshoeaus13_euro32>0 OR sizeshoeaus2_euro34>0 OR sizeshoeaus4_euro36>0 OR sizeshoeaus6_euro38>0 OR sizeshoeaus8_euro40>0 ) GROUP BY tbl_colour.pd_code ORDER BY display_order DESC, id DESC



