select count(*) as count_prod from products_to_categories as pc join products as p on p.products_id=pc.products_id join categories as c on c.categories_id=pc.categories_id where p.products_id= AND c.parent_id =2