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
tonMachine100Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SujithData ArchitectCommented:
Try this (For 9i)
select QST_QSE_ID, QST_TYPE ,QST_DESC ,AVD_DATA ,QST_CODE ,ASM_SUBJECT_ID ,ANS_ID ,ANV_NAME ,ANS_QST_CODE ,FIRST_NAME ,QQS_SEQ ,ANS_SEQ ,QST_ID
FROM (
SELECT 
QST_QSE_ID, QST_TYPE ,QST_DESC ,AVD_DATA ,QST_CODE ,ASM_SUBJECT_ID ,ANS_ID ,ANV_NAME ,ANS_QST_CODE ,FIRST_NAME ,QQS_SEQ ,ANS_SEQ ,QST_ID,
row_number() over(partition by FIRST_NAME, QST_QSE_ID order by ANV_NAME) rn
from <your table>
)
where rn = 1

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dportasCommented:
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?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.