I have the following select query. I want to convert it from string into a number. If I wrap a TO_NUMBER around the case expression, I get
expression must have same datatype as corresponding expression
error.
SELECT CASE SUBSTR(GRADE, INSTR(GRADE, ' ') + 1)
WHEN 'Unspecified' THEN ' '
ELSE SUBSTR(GRADE, INSTR(GRADE, ' ') + 1)
END as Final_Grade,
How can I get Final_Grade to be numeric?
Thank you!
WHEN 'Unspecified' THEN '' withWHEN 'Unspecified' THEN -1, or any other number that make senseCASE SUBSTR(GRADE, INSTR(GRADE, ' ') + 1)..