{if logged_in}
{exp:stash:set_list name="ids-with-two-class" parse_tags="yes" parse_conditionals="yes" trim="yes"}
{exp:query sql="SELECT pr.parent_entry_id as parent_id, count(*) FROM exp_playa_relationships pr WHERE pr.parent_field_id='535' GROUP BY pr.parent_entry_id having count(*) > 1 "}
{stash:id}{parent_id}{/stash:id}
{/exp:query}
{/exp:stash:set_list}
{exp:stash:get_list name="ids-with-two-class" parse="end" parse_tags="yes" parse_conditionals="yes"}
{exp:query sql="SELECT ct.title as the_title, field_id_878 as canon_url FROM exp_channel_data cd JOIN exp_channel_titles ct WHERE cd.entry_id = ct.entry_id AND cd.entry_id={id}"}
{the_title}
{/exp:query}
{/exp:stash:get_list}