Solved

selecting distinct values - oracle 10 sql syntax

Posted on 2011-03-14
3
239 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
  • 2
3 Comments
 
LVL 31

Expert Comment

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

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now