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 ') and p2c.categories_id = '170100' group by p.products_group' at line 1
select distinct p.products_group, sum(if(p.products_quantity > 0, p.products_quantity, 0)) as products_group_quantity from products p , products_to_categories p2c where p.products_status = '1' and p.products_id = p2c.products_id and p.products_group in () and p2c.categories_id = '170100' group by p.products_group