Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

I am wondering how to implement below PL/SQL scenario

Sangeeta PandeyJan 23 2024 — edited Jan 23 2024

Hello Experts,

I am wondering how to implement below scenario:

Write a sql query to group by records based on company , utility market and contract_number. if there is only one record found in that group
then pull that record. Else If multiple records found for that group then pull one with credit rating not null, if credit rating is not null for multiple records
in that group then pull one with duns_number not null, if credit rating and duns_number is not null for multiple records in that group then pull one with NAICS_Code not null .
If credit rating is null for all records in that group then pull one with DUNS_Number not null. if multiple records are having
duns_number not null then pull one duns_number and naics_code as not null.

Kindly help with suggestions.

Thanks,

This post has been answered by mathguy on Jan 31 2024
Jump to Answer
Comments
Post Details
Added on Jan 23 2024
9 comments
235 views