Solved

selecting distinct values - oracle 10 sql syntax

Posted on 2011-03-14
3
244 Views
Last Modified: 2012-08-13
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
0
Comment
Question by:tonMachine100
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 32

Expert Comment

by:awking00
ID: 35130157
See attached.
family-name-query.txt
0
 
LVL 32

Accepted Solution

by:
awking00 earned 500 total points
ID: 35407820
I feel like I did a lot of work just to have my answer discarded.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question