1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 1' at line 10

select p.products_image_med as products_image, pd.products_name, p.products_ordered, p.products_date_added, p.products_date_available, p.color_id, p.products_id, p.manufacturers_id, p.products_tax_class_id, IF(p.products_sort_order > 0, p.products_sort_order, 10000) as sort_order, p.products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products p inner join products_description pd on pd.products_id = p.products_id and pd.language_id = '1' inner join products_to_categories p2c on p.products_id = p2c.products_id left join specials s on s.products_id = p.products_id where p.products_status = '1' and (LEFT(p.products_date_available, 10) <= '2018-05-22' OR p.products_date_available IS NULL) and p2c.categories_id IN(154) group by p.products_id order by limit 1