select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products p left join specials s on p.products_id = s.products_id,products_to_categories ptc,categories where products_status = '1' and ptc.products_id = p.products_id and ptc.categories_id = categories.categories_id and parent_id = order by p.products_ordered desc limit 9