select apsh.apsh_team_group_id from active_photos_site_hierarchy apsh
where apsh.apsh_team_group_id in (
select apsh1.apsh_team_group_id from active_photos_site_hierarchy apsh1
group by apsh1.apsh_team_group_id
having count(apsh1.apsh_team_group_id) > 1)
group by apsh.apsh_team_group_id
order by apsh.apsh_team_group_id