Skip to content
Advertisement

how to using BETWEEN in CASE

so I want to make a case where if between the year of acceptance and the current year (sysdate) it is 1 to 5 it will be rank 1 and 6 to 10 rank 2

I using the code like this

But error it say ‘missing keyword’ in the when between 1 and 5

where EMPLOYEES table contains EMPLOYEE_ID,FIRST_NAME,HIRE_DATE columns

Advertisement

Answer

Since the expression should individually be written after each when clause such as

or more elegant option would be

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement