tonMachine100
asked on
Compare row values - oracle 9 sql
Please see the attached displaying - 1. the current table data and - 2. the desired output.
This data is looking at clients, assessments undertaken on them, and answers given in these assessments.
If a clients set of answers is replicated on another clients answers, I'd like the set of answers to only appear once and the clients numbers to be listed.
in this example, the question is asking about the clients ethnicity - there are 4 separate answers to the question - START_DATE, END_DATE, CAT_DESC and NOTES. As you can see in the answers given for clients 147 and 8456 in the AVD_DATA (answers column) matches so the clients answers only appear once.
I'm not sure if this is possible. Any help is appreciated.
Answers-Report-1-.xls
This data is looking at clients, assessments undertaken on them, and answers given in these assessments.
If a clients set of answers is replicated on another clients answers, I'd like the set of answers to only appear once and the clients numbers to be listed.
in this example, the question is asking about the clients ethnicity - there are 4 separate answers to the question - START_DATE, END_DATE, CAT_DESC and NOTES. As you can see in the answers given for clients 147 and 8456 in the AVD_DATA (answers column) matches so the clients answers only appear once.
I'm not sure if this is possible. Any help is appreciated.
Answers-Report-1-.xls
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hey Richard you forget to leave your EE link
is it this one ?
https://www.experts-exchange.com/questions/23835552/Combine-record-to-a-single-string-in-a-group-in-Oracle.html
is it this one ?
https://www.experts-exchange.com/questions/23835552/Combine-record-to-a-single-string-in-a-group-in-Oracle.html
Sorry! :P
It is https://www.experts-exchange.com/questions/21429673/Concatenate-multiple-rows-into-one-row-Oracle.html
Thanks for the catch! :)
It is https://www.experts-exchange.com/questions/21429673/Concatenate-multiple-rows-into-one-row-Oracle.html
Thanks for the catch! :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thankyou both for your help.
Do you think the same output could be derived from just using sql (ie no pl)? I'm no expert with pl, so i'd find a solution in just sql easier to understand!
thanks again.
Do you think the same output could be derived from just using sql (ie no pl)? I'm no expert with pl, so i'd find a solution in just sql easier to understand!
thanks again.
It can be done with sql. Not a direct one, but with some tricky stuff in it. Using hierarchical queries and stuff.
But the sql will get too huge as there are many join columns, which makes it much difficult to maintain the code. This is neater.
But the sql will get too huge as there are many join columns, which makes it much difficult to maintain the code. This is neater.
jfmador, thanks for you comment. I will find this discussion very useful in the future. Also, thank you tonMachine100 for bringing this up. :)