ORACLE SQL CASE ERROR FROM KEYWORD

0

I am looking for solutions to the error that is presented to me at the time of writing this query (I am new to the platform, I regret the inappropriate documentation of the code):

 SELECT  EVALUATION
 CASE 
   WHEN EVALUATION = '1' THEN 'Malo'
   WHEN EVALUATION = '2' THEN 'Regular'
   WHEN EVALUATION = '3' THEN 'OK'
   WHEN EVALUATION = '4' THEN 'Bueno'
   WHEN EVALUATION = '5' THEN 'Excelente'
 ELSE 'No diligenciado' END 
 FROM REGISTRATIONS;

Now, although it seems that this is in order, I get error FROM keyword not found where expected

Also try the following way:

SELECT
   EVALUATION
    decode ( EVALUATION, 
                     '1','MALO',
                     '2','REGULAR',
                     '3','OK',
                     '4','BUENO',
                     '5','EXCELENTE',
                     'NO FUE DILIGENCIADO')STATUSTEXT
  FROM REGISTRATIONS;

I get the same error.

    
asked by Deivid Stiven Medina Hernandez 27.06.2018 в 05:56
source

1 answer

0

Try to do the query in the following way:

SELECT EVALUATION,
(CASE REGISTRATIONS.EVALUATION
    WHEN '1' THEN 'Malo'
    WHEN '2' THEN 'Regular'
    WHEN '3' THEN 'OK'
    WHEN '4' THEN 'Bueno'
    WHEN '5' THEN 'Excelente'
    ELSE 'No diligenciado'
END) 
FROM REGISTRATIONS;
    
answered by 27.06.2018 / 10:42
source