select p.products_id
from products_to_categories_all p2c, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id
where p.products_status = '1' and p.parent = '0'
and p.products_id = p2c.products_id
and p2c.categories_id= '27'