An Error Was Encountered
Error Number: 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 p.enabled=1 and p.sold_out='N' and p.id in (select distinct product_id from ' at line 1
select c1.id as category_id, c1.type as category_name, c1.chinese_type, count(distinct p.id) as tot_product_num from products p join category c1 on p.category_id=c1.id join category c2 on c1.parent_id=c2.id where p.sale_price>=2 and p.sale_price<=3 and c2.id= and p.enabled=1 and p.sold_out='N' and p.id in (select distinct product_id from image) group by c1.id