selecting distinct values - oracle 10 sql syntax

Please see the attachment.

fig 1. Is the current output.
fig 2. is the desired output (displaying the new calculated field FAMILY_NAME)

I need the output to display the distinct source surname and relationship surnames that appear on the same row. for example

- source id 121572 (RUTTA) has 5 relations with the surnames of either RUTTA and HUGHES - therefore the family name(s) is HUGHES/ RUTTA.
- source id 171554 (WORTHINGTON) does not have any relations so the family name is just WORTHINGTON.
- source id 185080 (HAIGH) has 2 relations with the surnames HAIGH and WEBB therefore the family name is HAIGH/ WEBB

If there are different surname for the family (as per example 1 and 3) the family names should appear in alphabetical order.

any help is appreciated





rel-example.xls
tonMachine100Asked:
Who is Participating?
 
awking00Connect With a Mentor Commented:
I feel like I did a lot of work just to have my answer discarded.
0
 
awking00Commented:
See attached.
family-name-query.txt
0
All Courses

From novice to tech pro — start learning today.