select count(*) as cnt from ( select c.goodsno from breed_store_multicategory a inner join breed_store_category b on a.cateno=b.cateno inner join breed_store_goods c on c.goodsno=a.goodsno where b.lft between AND and goods_view=0 group by c.goodsno ) as tbl


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 and goods_view=0 group by c.goodsno ) as tbl' at line 6