Как насчет:
select
p.persons,
case when 1 in (select 1 from role_person rp where rp.personid = p.personid and rp.roleid = 1) then 'Y' else '-' end as friend,
case when 1 in (select 1 from role_person rp where rp.personid = p.personid and rp.roleid = 2) then 'Y' else '-' end as son,
case when 1 in (select 1 from role_person rp where rp.personid = p.personid and rp.roleid = 3) then 'Y' else '-' end as daughter,
case when 1 in (select 1 from role_person rp where rp.personid = p.personid and rp.roleid = 4) then 'Y' else '-' end as father,
case when 1 in (select 1 from role_person rp where rp.personid = p.personid and rp.roleid = 5) then 'Y' else '-' end as mother,
case when 1 in (select 1 from role_person rp where rp.personid = p.personid and rp.roleid = 6) then 'Y' else '-' end as brother,
case when 1 in (select 1 from role_person rp where rp.personid = p.personid and rp.roleid = 7) then 'Y' else '-' end as sister
from person p;
Результат:
persons friend son daughter father mother brother sister
James - Y - - - - -
Peter - Y - Y - Y -
Joseph - - - Y - - -
Jeni - - Y - - - -