当我尝试运行此SELECT
语句时,我收到此错误:ORA-00904: "GPASCORE": invalid identifier
. 如何gpaScore
CASE
在子句中使用语句的结果WHERE
?
SELECT
(CASE grade
WHEN 'A+'
THEN 4
WHEN 'A'
THEN 4
WHEN 'A-'
THEN 3.7
WHEN 'B+'
THEN 3.3
WHEN 'B'
THEN 3
WHEN 'B-'
THEN 2.7
WHEN 'C+'
THEN 2.3
WHEN 'C'
THEN 2
WHEN 'C-'
THEN 1.7
WHEN 'D+'
THEN 1.3
WHEN 'D'
THEN 1
WHEN 'D-'
THEN 0.7
WHEN 'F'
THEN 0
ELSE NULL END) gpaScore
FROM PGFINALGRADES
WHERE gpaScore = 3