Error: 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 ') GROUP BY op.product_id ORDER BY total DESC LIMIT 50' at line 1
Error No: 1064
SELECT op.product_id, SUM(op.quantity) AS total,ptc.category_id FROM order_product op LEFT JOIN `order` o ON (op.order_id = o.order_id) left join `product_to_category` ptc on (ptc.product_id=op.product_id) WHERE o.order_status_id > '0' and ptc.category_id in () GROUP BY op.product_id ORDER BY total DESC LIMIT 50