select category_id from categories c where c.tree_id = :tree_id and exists (select 1 from category_object_map where category_id = c.category_id)