Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calculate MEDIAN of CHAR values in multiple columns

3121955Jun 12 2017 — edited Jun 13 2017

Hi,

I habe been stuck for days on a query, which now seems to me quite impossible to build.

For a list of bonds I have to calculate the median of three rating figures, which are in three separated columns and are unfortunately on text format (VARCHAR2).


For instance:
 

My idea would be to convert each Level of the 3 alphanumeric codes into a common and unique numerical ID (NUMBER Format).

For instance:

Then, I have to calculate the MEDIAN on the corresponding numbers, and this for each bond.

I cannot find a solution..

Please help.

NB: on my SQL Developer Desk I am only allowed to use the SELECT function.

Thanks a lot in advance for your assistance.

Cheers

Rani

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 11 2017
Added on Jun 12 2017
16 comments
935 views