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!

Suggestion required

RajatOct 28 2014 — edited Oct 28 2014

Dear All,

Could you please suggest what is wrong in the below statement and how can i get a output from below table. I donot want to use round( 12 *100 / (5*4)) score in subquery.

SQL> select     round( 12 *100 / (5*4)) score,                

  2            (case

  3             WHEN score between 81 and 100 then 'EXCELLENT'

  4             when score between 61 and 80  then 'GOOD'

  5             WHEN score between 41 and 60 then  'AVARAGE'

  6             else 'POOR'

  7          end) performence1

  8    from dual;

           WHEN score between 81 and 100 then 'EXCELLENT'

                *

ERROR at line 3:

ORA-29900: operator binding does not exist

ORA-06553: PLS-306: wrong number or types of arguments in call to 'SCORE'

Below query works fine

select                     
          (case
           WHEN score between 81 and 100 then 'EXCELLENT'
           when score between 61 and 80  then 'GOOD'
           WHEN score between 41 and 60 then  'AVARAGE'
           else 'POOR'
        end)
  from ( select round( 12 *100 / (5*4))score from dual );

But i want to achieve it in a single query.

Regards

Rajat

This post has been answered by John Spencer on Oct 28 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 25 2014
Added on Oct 28 2014
10 comments
237 views