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 '-456, 57' at line 16
select p.products_ordered, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_price1, p.products_price2, p.products_cost, pd.features1, p.products_id, p.products_image_med, p.range_status, p.manufacturers_id, p.products_price, p.products_tax_class_id, 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, PVL.parent_title, PVL.is_main, PVL.parent_sku, PVL.list_variations, PVL.variation_theme, p.products_quantity,il.qty_in_stock_cre_adjustment,
(SELECT list_variations FROM isellsco_isell.isells_products_variations_list a where PVL.parent_sku = a.parent_sku and a.is_main = 1) as l_v
from products p
left join specials_retail_prices s on p.products_id = s.products_id
left join manufacturers m on p.manufacturers_id = m.manufacturers_id
left join products_description pd on p.products_id = pd.products_id
left join products_to_categories p2c on p.products_id = p2c.products_id
left join isellsco_isell.isells_products_link il on p.products_id = il.products_id
LEFT JOIN isellsco_isell.isells_products_variations_list PVL on p.products_id = PVL.child_id
where p.products_status IN (1,5,6)
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
and pd.language_id = '1'
and p2c.categories_id = '1512'
AND (PVL.is_main = 1 or PVL.is_main IS NULL)
and (products_group_access like "%,G,%" or products_group_access like "G,%" or products_group_access like "%,G" or products_group_access="G") order by p.products_ordered desc, pd.products_name limit -456, 57