Link to home
Start Free TrialLog in
Avatar of tonMachine100
tonMachine100

asked on

Selecting distinct rows - oracle 9 sql

Please see the attached which displays a) the current output and b) the desired output.

This data is looking at a questions and answers given in two electronic forms for two different clients. The question text appears in the QST_DESC column. Any answers given will appear in the AVD_DATA column. If an answer has been provided, the string DATA will appear in the ANV_NAME column.

I would like each question (and answer) row to only appear once for each client- so if the clients question has been answered I would like this row to appear (there will be the text DATA in the ANV_NAME column), if no answer has been provided the row will not have the word DATA in the ANV_NAME column and I would like this row to appear.

I hope this make some sort of sense!  Any help with this is appreciated.

sample.xls
ASKER CERTIFIED SOLUTION
Avatar of Sujith
Sujith
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dportas
dportas

What key(s) exist in your table? When there is more than one answer for a question which one do you want to return? Do you want to pick one at random or should some rule be applied?